version 1.5, 1999/03/23 20:24:23
|
version 1.6, 1999/11/08 22:01:10
|
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 Return the string for the @var{n}th command-line argument. |
\g Return the string for the @i{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{\} |
Line 29
|
Line 29
|
|
|
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 VARIABLE: A pointer to a vector of pointers to the command-line |
\g @code{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 VARIABLE: The number of command-line arguments (including the command name). |
\g @code{Variable} -- the number of command-line arguments (including the command name). |
|
|
0 Value script? ( -- flag ) |
0 Value script? ( -- flag ) |
|
|