\ @(#) misc1.fth 98/01/26 1.2
\ Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom
\ The pForth software code is dedicated to the public domain,
\ and any third party may reproduce, distribute and modify
\ the pForth software code or any derivative works thereof
\ without any compensation or license. The pForth software
\ code is provided on an "as is" basis without any warranty
\ of any kind, including, without limitation, the implied
\ warranties of merchantability and fitness for a particular
\ purpose and their equivalents under the laws of any jurisdiction.
: (WARNING") ( flag $message -- )
: WARNING" ( flag <message> -- , print warning if true. )
[compile] " ( compile message )
: (ABORT") ( flag $message -- )
: ABORT" ( flag <message> -- , print warning if true. )
[compile] " ( compile message )
: ?PAUSE ( -- , Pause if key hit. )
IF key drop cr ." Hit space to continue, any other key to abort:"
key dup emit BL = not abort" Terminated"
: CR? ( -- , do CR if near end )
OUT @ #cols 16 - 10 max >
: CLS ( -- clear screen )
: PAGE ( -- , clear screen, compatible with Brodie )
: $ ( <number> -- N , convert next number as hex )
bl lword number? num_type_single = not
abort" Not a single number!"
variable TAB-WIDTH 8 TAB-WIDTH !
: TAB ( -- , tab over to next stop )
tab-width @ swap - spaces
WHILE dup id. tab cr? ?pause
: >NAME ( xt -- nfa , scans dictionary for closest nfa, SLOW! )
IF ( -- addr nfa ) 2dup name> ( addr nfa addr xt ) <
IF true ( addr below this cfa, can't be it)
2dup name> ( addr nfa addr xt ) =
IF ( found it ! ) dup closest-nfa ! false
ELSE dup name> closest-xt @ >
IF dup closest-nfa ! dup name> closest-xt !
: @EXECUTE ( addr -- , execute if non-zero )
: TOLOWER ( char -- char_lower )
: EVALUATE ( i*x c-addr num -- j*x , evaluate string of Forth )
\ save current input state and switch to passed in string
: \S ( -- , comment out rest of file )
BEGIN \ using REFILL is safer than popping SOURCE-ID