home *** CD-ROM | disk | FTP | other *** search
- 10 '**************************************************************************
- 20 ' taken from *.* column in PC World, November, 1983 with a mod to get rid
- 30 ' of a leading space on the parameter string. useful for compiled BASIC
- 40 ' only.
- 50 ' If you start a program with a command line such as "a>PROGRAM ABCDEFGH"
- 60 ' Then PARM will be "ABCDEFGH"
- 70 ' basparm.bas--this is a program fragment, include at the start of your program
- 80 DEF SEG :'point data segment register to basic
- 90 DIM SUBR%(3) :'array to contain machine subroutine
- 100 DEF USR0=VARPTR(SUBR%(0)) :'get subroutine's segment offset
- 110 SUBR%(0)=&H5B59 :'pop CX pop BX
- 120 SUBR%(1)=&H5153 :'push BX push CX
- 130 SUBR%(2)=&HEB83 :'sub BX,10H
- 140 SUBR%(3)=&HCB10 :'retf
- 150 I%=0 :'dummy parameter to functionn call
- 160 PSP%=USR0(I%) :'get program segment prefix's segment
- 170 DEF SEG=PSP% :'set base register at that segment
- 180 PARMLEN%=PEEK(&H80) :'get command parameter length
- 190 PARM$="" :'set up string to receive the string
- 200 FOR I% = 2 TO PARMLEN% :'loop thru parameter string but skip
- 210 PARM$=PARM$+CHR$(PEEK(&H80+I%)) :'leading blank char. collect whole string
- 220 NEXT I% :'until end of the string
- 230 DEF SEG :'return to normal data string
- 240 '**************************************************************************