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