1 REM Ins{nd av Benny L|fgren SYSOP <2615>    1986-09-18 12.39.17 (KERMIT)
FIXPAR    PROG  ** RUNBAS ** FORMAT PARAMETER STRING
*
          RADIX 16
          SQUEZ
*
FIXPAR*   LA    HL,MCMDR.         POINT AT STRING TO CONVERT

*
SCANPAR   L     A,(HL)            FIND PAR:S (SKIP SWITCHES FOR NOW)
          INCD  HL
          CI    ' '               DELIMITER FOR PARAMETER FIELD
          JZS   PARFOUND
          CI    0DH               END OF STRING (=NO PARAMETER FIELD)
          JNZS  SCANPAR
          JMPS  PAREND
*
PARFOUND  L     A,(HL)            COPY PARAMETER STRING
          INCD  HL
          CI    ' '               SKIP SPACES
          JZS   PARFOUND
          DECD  HL
*
PARCOPY   L     A,(HL)
          CI    0DH               END OF STRING?
          JZS   PAREND
          ST    A,(DE)
          INCD  HL
          INCD  DE
          JMPS  PARCOPY
*
PAREND    LA    HL,MCMDR.         REWIND STRING POINTER
*
SCANSWI   L     A,(HL)            NOW, SCAN FOR SWITCH FIELD
          INCD  HL
          CI    ','               DELIMITER FOR SWITCH FIELD
          JZS   SWIFOUND
          CI    '/'               ALSO LEGAL AS DELIMITER
          JZS   SWIFOUND
          CI    ' '               PAR FIELD FOUND -> NO SWITCH FIELD
          JZS   ENDSWI
          CI    0DH               NOTHING FOUND
          JNZS  SCANSWI
*
ENDSWI    EXDR                    INSERT A <CR> IN BUFFER
          MVI   0DH,(HL)
          RET
*
SWIFOUND  L     A,(HL)            GET SWITCH
          INCD  HL
          CI    ' '               NO MORE SWITCHES
          JZS   ENDSWI
          CI    0DH               -"-
          JZS   ENDSWI
          CI    ','               CHECK IF THE JERK HAS SEPARATED THE SWITCHES
          JZS   SWIFOUND
          CI    '/'
          JZS   SWIFOUND
          EXDR                    HL - BUFFER POINTER
          MVI   ' ',(HL)          CONVERT SWITCH TO THE FORM ' -S'
          INCD  HL
          MVI   '-',(HL)
          INCD  HL
          ST    A,(HL)            THE VERY SWITCH
          INCD  HL
          EXDR
          JMPS  SWIFOUND
*
          END
