command$ ACTUAL CASE?

 BBS: Inland Empire Archive
Date: 04-24-92 (21:03)             Number: 161
From: LOGAN ASHBY                  Refer#: 153
  To: DAVID BLISS                   Recvd: NO  
Subj: command$ ACTUAL CASE?          Conf: (2) Quik_Bas
In a msg of <19 Apr 92>, David Bliss writes to all:

 DB > Is there any way to get the COMMAND$ in the case it was entered?

    This should handle it.  It reads it directly out of the
Program Segment Prefix.  You need to do it as early as
possible in your code, 'cause it can (and probably will) be
overwritten the first time you do any disk access. Don't
forget to load the Quick Library for the CALL Interrupt()
when you fire up the IDE. ;-)

' GetCmd - Logan Ashby - 04/24/92 - Public Domain ' WARNING! Q&D hack from the amazing Kludge-o-matic, use at your ' own risk. <grin> '
' $INCLUDE: 'QB.BI' DIM Reg AS RegType = &H6200 '| Get PSP Address CALL Interrupt(&H21, Reg, Reg) PSPSeg% = Reg.bx CmdLine$ = "" '| Initialize Command Line DEF SEG = PSPSeg% CmdLineBytes% = PEEK(&H80) '| # characters in Cmd Line FOR i% = 1 TO CmdLineBytes% '| Build line CmdLine$ = CmdLine$ + CHR$(PEEK(&H80 + i%)) NEXT i% DEF SEG CmdLine$ = LTRIM$(RTRIM$(CmdLine$)) PRINT "CmdLine$ = "; CmdLine$ END --- GoldED 2.40 * Origin: Big Nerd's Nest (1:398/1.2)
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