BBS: Inland Empire Archive Date: 02-02-93 (00:08) Number: 389 From: JOE NEGRON Refer#: NONE To: RAYMOND PAQUIN Recvd: NO Subj: Re: QuickBASIC Conf: (2) Quik_Bas
JJ> I don't think you need to use UCASE$ as COMMAND$ always returns
> uppercase anyway.
RP> Since this is a QuickBASIC conference, you are technically right.
> But I *SEEM* to remember that PDS doesn't do that. I could be wrong.
No, unfortunately, PDS also capitalizes COMMAND$. You can retrieve the
command line, case preserved, with the following:
========================== Begin CMDLINE.BAS ===========================
DEFINT A-Z
'$INCLUDE: 'qbx.bi'
DECLARE FUNCTION CmdLine$ ()
'***********************************************************************
'* FUNCTION CmdLine$
'*
'* PURPOSE
'* Uses DOS ISR 21H, Function 51H (Get PSP Address) to return the
'* command line unmodified. COMMAND$ is capitalized by BASIC, hence
'* this function.
'*
'* EXTERNAL ROUTINE(S)
'* QBX.LIB
'* -------
'* SUB Interrupt (IntNum%, IRegs AS RegType, ORegs AS RegType)
'***********************************************************************
FUNCTION CmdLine$ STATIC
DIM IRegs AS RegType, ORegs AS RegType
IRegs.ax = &H5100
Interrupt &H21, IRegs, ORegs
PSP% = ORegs.bx 'Segment returned in BX
Offset% = &H80 'Offset% of command line
DEF SEG = PSP% 'Access PSP segment
CmdLen% = PEEK(Offset%) 'Get command line length
Cmd$ = SPACE$(CmdLen%) 'Read parameters....
FOR I% = 1 TO CmdLen%
MID$(Cmd$, I%, 1) = CHR$(PEEK(Offset% + I%))
NEXT I%
DEF SEG 'Restore DGROUP
CmdLine$ = RTRIM$(Cmd$) 'Return value
Cmd$ = ""
END FUNCTION
=========================== End CMDLINE.BAS ============================
--Joe in Bay Ridge, Brooklyn, NY--
Tue 02-02-1993, 00:08
... It is completely dark. You may be eaten by a grue.
___
X Blue Wave/QWK v2.12 X
--- Maximus 2.01wb
* Origin: * BlueDog BBS * (212) 594-4425 * NYC FileBone Hub (1:278/709)

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