1 \ @(#) misc1.fth 98/01/26 1.2
5 \ Copyright 1994 3DO, Phil Burk, Larry Polansky, Devid 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.
21 : CELL* ( n -- n*cell ) 2 lshift ;
23 : (WARNING") ( flag $message -- )
30 : WARNING" ( flag <message> -- , print warning if true. )
31 [compile] " ( compile message )
38 : (ABORT") ( flag $message -- )
40 IF count type cr abort
45 : ABORT" ( flag <message> -- , print warning if true. )
46 [compile] " ( compile message )
54 : ?PAUSE ( -- , Pause if key hit. )
56 IF key drop cr ." Hit space to continue, any other key to abort:"
57 key dup emit BL = not abort" Terminated"
63 : CR? ( -- , do CR if near end )
64 OUT @ #cols 16 - 10 max >
69 : CLS ( -- clear screen )
72 : PAGE ( -- , clear screen, compatible with Brodie )
76 : $ ( <number> -- N , convert next number as hex )
78 32 lword number? num_type_single = not
79 abort" Not a single number!"
93 variable TAB-WIDTH 8 TAB-WIDTH !
94 : TAB ( -- , tab over to next stop )
96 tab-width @ swap - spaces
103 WHILE dup id. tab cr? ?pause
113 : >NAME ( xt -- nfa , scans dictionary for closest nfa, SLOW! )
118 IF ( -- addr nfa ) 2dup name> ( addr nfa addr xt ) <
119 IF true ( addr below this cfa, can't be it)
121 2dup name> ( addr nfa addr xt ) =
122 IF ( found it ! ) dup closest-nfa ! false
123 ELSE dup name> closest-xt @ >
124 IF dup closest-nfa ! dup name> closest-xt !
133 REPEAT ( -- cfa nfa )
138 : @EXECUTE ( addr -- , execute if non-zero )
144 : TOLOWER ( char -- char_lower )
147 IF ascii A - ascii a +