BCX Console Demonstration Program s141.bas

 $COMMENT
 *********************************************************************
 This demonstrates the new and expanded COMMAND$ function written
 by Pat Kelly. This version of COMMAND$ works with GUI and console
 mode programs, is fully backward compatible, and now provides easy
 access to individual command line arguments.
 *********************************************************************
 $COMMENT
 
 DIM cmd$
 DIM i AS INTEGER
 
 cmd$ = COMMAND$
 
 PRINT "Full command tail: [", cmd$, "]"
 PRINT "The executable name is [", COMMAND$(0), "]"
 
 i = 1
 
 cmd$ = COMMAND$(i)
 
 WHILE cmd$ <> ""
   PRINT "Argument", i, " is [", cmd$, "]"
   i++
   cmd$ = COMMAND$(i)
 WEND
 
 PRINT "Total arguments:", i - 1