forked from KolibriOS/kolibrios
git-svn-id: svn://kolibrios.org@4867 a494cfbc-eb01-0410-851d-a64ba20cac60
34 lines
749 B
Forth
34 lines
749 B
Forth
( —⥨¥ áâப¨ ¨á室®£® ⥪áâ ¨§ ¢å®¤®£® ¯®â®ª : ª®á®«¨ ¨«¨ ä ©« .
|
||
Copyright [C] 1992-1999 A.Cherezov ac@forth.org
|
||
<EFBFBD>¥¢¨§¨ï: ‘¥âï¡àì 1999
|
||
)
|
||
|
||
VECT <PRE>
|
||
|
||
: CONSOLE-HANDLES \ $$$$
|
||
;
|
||
|
||
: QUERY ( --- )
|
||
\ Read a line from the terminal into the terminal input buffer.
|
||
TIB 80 ACCEPT #TIB ! 0 >IN ! ;
|
||
|
||
: FREFILL ( h -- flag )
|
||
TIB C/L ROT READ-LINE THROW \ TAKEN-TIB
|
||
SWAP #TIB ! 0 >IN ! CURSTR 1+!
|
||
0 SOURCE + C!
|
||
;
|
||
|
||
|
||
: REFILL ( --- f)
|
||
\ Refill the current input source when it is exhausted. f is
|
||
\ true if it was successfully refilled.
|
||
|
||
SOURCE-ID -1 = IF
|
||
0 \ Not refillable for EVALUATE
|
||
ELSE SOURCE-ID
|
||
IF SOURCE-ID FREFILL
|
||
ELSE QUERY -1 \ Always successful from terminal.
|
||
THEN
|
||
THEN
|
||
;
|