[gforth] / gforth / kernel / args.fs  

gforth: gforth/kernel/args.fs

Diff for /gforth/kernel/args.fs between version 1.4 and 1.5

version 1.4, Tue Dec 8 22:03:08 1998 UTC version 1.5, Tue Mar 23 20:24:23 1999 UTC
Line 21 
Line 21 
 : cstring>sstring  ( cstring -- addr n ) \ gforth       cstring-to-sstring  : cstring>sstring  ( cstring -- addr n ) \ gforth       cstring-to-sstring
     -1 0 scan 0 swap 1+ /string ;      -1 0 scan 0 swap 1+ /string ;
 : arg ( n -- addr count ) \ gforth  : arg ( n -- addr count ) \ gforth
     \g returns the string for the @var{n}th command-line argument.      \g Return the string for the @var{n}th command-line argument.
     cells argv @ + @ cstring>sstring ;      cells argv @ + @ cstring>sstring ;
 : #! ( -- ) \ gforth   hash-bang  : #! ( -- ) \ gforth   hash-bang
     \g an alias for @code{\}      \g An alias for @code{\}
     postpone \ ;  immediate      postpone \ ;  immediate
   
 Create pathstring 2 cells allot \ string  Create pathstring 2 cells allot \ string
 Create pathdirs   2 cells allot \ dir string array, pointer and count  Create pathdirs   2 cells allot \ dir string array, pointer and count
 Variable argv ( -- addr ) \ gforth  Variable argv ( -- addr ) \ gforth
 \g contains a pointer to a vector of pointers to the command-line  \g VARIABLE: A pointer to a vector of pointers to the command-line
 \g arguments (including the command-name). Each argument is  \g arguments (including the command-name). Each argument is
 \g represented as a C-style string.  \g represented as a C-style string.
 Variable argc ( -- addr ) \ gforth  Variable argc ( -- addr ) \ gforth
 \g contains the number of command-line arguments (including the command name)  \g VARIABLE: The number of command-line arguments (including the command name).
   
 0 Value script? ( -- flag )  0 Value script? ( -- flag )
   


Generate output suitable for use with a patch program
Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help