Command Line Switches

 BBS: Inland Empire Archive
Date: 11-15-92 (13:07)             Number: 394
From: PETER BARNEY                 Refer#: NONE
  To: MATT ROBERTS                  Recvd: NO  
Subj: Command Line Switches          Conf: (2) Quik_Bas
 >  MR> Really?  I didn't know that (obviously :-).  What if you want your
 >  MR> command arguments to be case sensitive?  Can you still use LCASE$ or
 >  MR> is that cancelled by COMMAND$?


'$INCLUDE: 'QBX.BI'

FUNCTION CommandTail$
    'Returns the command line.  Unlike QB's COMMAND$ function, this will
    'return the original command line without converting to uppercase,
    'as well as leaving all leading and trailing spaces.

    DIM Regs as RegType

    Regs.ax = &H6200    'Get process ID (PSP segment)
    CALL Interrupt(&H21, Regs,Regs)
    PSP = Regs.bx
    DEF SEG = PSP

    ComLineLength = PEEK(&H80) 'length of command line
    FOR X = &H81 TO &H81 + ComLineLength - 1
        c$ = c$ + CHR$(PEEK(X))
    NEXT
    CommandTail$ = c$
END FUNCTION


Hope this helps!  (And don't forget to change QBX.BI to
QB.BI if you don't use PDS!)

--- FMail 0.92
 * Origin: Pete's Place (1:234/35.1)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET