Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4867 leency 1
( Чтение строки исходного текста из входного потока: консоли или файла.
2
  Copyright [C] 1992-1999 A.Cherezov ac@forth.org
3
  Ревизия: Сентябрь 1999
4
)
5
 
6
VECT 
7
 
8
: CONSOLE-HANDLES \ $$$$
9
;
10
 
11
: QUERY ( --- )
12
\ Read a line from the terminal into the terminal input buffer.
13
  TIB 80 ACCEPT #TIB ! 0 >IN ! ;
14
 
15
: FREFILL ( h -- flag )
16
  TIB C/L ROT READ-LINE THROW \ TAKEN-TIB
17
  SWAP  #TIB !  0 >IN ! CURSTR 1+!
18
 
19
;
20
 
21
 
22
: REFILL ( --- f)
23
\ Refill the current input source when it is exhausted. f is
24
\ true if it was successfully refilled.
25
 
26
  SOURCE-ID -1 = IF
27
 
28
  ELSE   SOURCE-ID
29
   IF    SOURCE-ID FREFILL
30
   ELSE  QUERY -1 \ Always successful from terminal.
31
   THEN
32
  THEN
33
;