command$ ACTUAL CASE?

 BBS: Inland Empire Archive
Date: 04-24-92 (16:55)             Number: 186
From: MICHAEL MALLEY               Refer#: 179
  To: DAVID BLISS                   Recvd: NO  
Subj: command$ ACTUAL CASE?          Conf: (2) Quik_Bas
DB>Is there any way to get the COMMAND$ in the case it was
DB>entered?  I have a kludge for 4DOS but I cant use that in
DB>anything I distribute.  any help will be appreciated.

MM>There is a way, but you will have to trace through the Program
MM>Segment Prefix (PSP) by yourself to do it.

David, I'm sorry.  I meant to include the code before, but forgot to
when I U/Led my packet.  Here is what you have to do.

 -----------------------[ COMMAND.BAS]-------------------------
TYPE RegTypeX
     ax    AS INTEGER
     bx    AS INTEGER
     cx    AS INTEGER
     dx    AS INTEGER
     bp    AS INTEGER
     si    AS INTEGER
     di    AS INTEGER
     flags AS INTEGER
     ds    AS INTEGER
     es    AS INTEGER
END TYPE
DECLARE SUB InterruptX (intnum AS INTEGER, Inreg AS RegTypeX, outreg AS_
RegTypeX)

DIM Regs AS RegTypeX

Regs.ax = &H2F * 256
InterruptX &H21, Regs, Regs
DEF SEG = Regs.es

Offset = Regs.bx
Length = PEEK(Offset)

Cmd$ = SPACE$(Length)

FOR Counter = Offset + 1 TO Offset + Length
    MID$(Cmd$, (Counter - Offset)) = CHR$(PEEK(Counter))
NEXT Counter

PRINT Cmd$

DEF SEG

 * SLMR 2.1a * Real men *do* cry...

--- Maximus 2.01wb
 * Origin: UltraTech - Nashville, TN  (615) 356-0453 {HST} (1:116/30)
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