( 'env-string --- )
"get-e-n-v". Retrieves the system environment variable whose
name is contained in 'env-string. The original value is
replaced with the value returned by the system.
80 string value
value " UNTIL-DIR" strcpy
value dup count type cr
( col row --- )
"go to x-y". Position the screen cursor to column col and
row row. This word uses a Borland C++ specific function and
may need modification with other compilers.
( 'string 'search 'replace --- #matches )
"g-sub". The global search and replace word searches string
for search and replaces it with replace when a
match occurs. This version performs multiple replacements in
the string. The number of replacements is returned.
inbuf 1+ " is" " is not" gsub
Searches <INBUF> for occurrences of "is" and replaces each with
( --- )
"help". Looks up the specified word name in HELP.APP
and prints the entry to the screen. Usage:
prints the help entry for "do". Use the words command to type the
( --- 'here )
"here". Push the address contained in the system variable, here
onto the parameter stack. In Until,
here is allocated at startup. Most other
Forths allow it to float at the end of the dictionary. here
is initially 128 bytes. here and pad are the
( --- )
"hex". Set the current base to 16.
( char --- )
"hold". Add char to the numeric string. hold is used
with <# ... #> to format numbers.
( --- i )
"i". Push the current do loop index onto the Data Stack. When loops
are nested, i always refers to the current loop.
10 0 do i loop ;
( tf --- )
"if". Test the value on the top of the stack for True or False.
5 5 =
if " True comparison"
else " False comparison"
The function do_if is executed at run-time.
( --- )
"immediate". Flag the last word in the dictionary as immediate. An
immediate word executes at compile time rather than being compiled
into the dictionary. Words such as if and do
are immediate. Until
primitives built with build_iprim() are immediate.
( --- )
"include". Compiles the file specified as the next token in the
Compiles the file, source.fth, then returns to normal interpretation of
the console. include is nestable.
( 'string 'new-string --- 'string )
"insert". Insert new-string at the beginning of string.
The address of the original string is returned.
Table of Contents