.. _cmd-dlr: CMD$ ==== +----------+-------------------------------------------------------------------+ | Syntax | CMD$ | +----------+-------------------------------------------------------------------+ | Location | SMS, Minerva | +----------+-------------------------------------------------------------------+ This function can be used from within SMS SBASICs, Minerva MultiBASICs and compiled programs (not SuperBASIC Job 0) to read a string passed to the program when it was initiated, with the command EX (or similar). The string appears after the EX command, preceded with a semicolon. **Example** Create a program to load in Xchange and set its default drives and memory, something akin to: :: 10 xch_data$=DATAD$:xch$=PROGD$ 20 data_space=300 30 x$=CMD$ 40 IF x$<>'' 45 datpos='\' INSTR x$ 50 IF datpos:data_space=x$(datpos+1 TO) 55 IF datpos>5:x$=x$(1 TO datpos-1) 74 dr1=',' INSTR x$ 75 IF dr1<6 80 IF dr1=0:PROG_USE x$(1 TO):ELSE IF dr1win1\_XCHANGE,flp2\_\\200' This will execute win1\_XCHANGE\_xchange with the help file to be loaded from win1\_XCHANGE\_ , the data files being loaded from flp2\_ and a dataspace of 200K. **NOTE 1** In SMS pre v2.60, you could not directly slice CMD$ - copy it to another string variable first, as in the example. **NOTE 2** You cannot use this command in TURBO compiled jobs - use OPTION\_CMD$ instead. **CROSS-REFERENCE** See :ref:`exec` and :ref:`exec-w`.