various improvements
[rrq/rrqforth.git] / adoc / p_read_word.adoc
1 // stdio.asm:   WORD p_read_word,'READ-WORD',fasm
2
3 anchor:p_read_word[]
4
5 === Word: READ-WORD
6 ....
7 Data stack: ( stream -- char* n )
8 ....
9
10 "READ-WORD" is a function word that "reads" the next whitespace
11 separated word from the given stream and returns the [n:char*] duoble
12 cell pointer for it. The characters of the word are copied to
13 <<p_pad,PAD>>, and there is a limit of 1024 characters.
14
15 At the end of the stream READ-WORD returns 0 length.
16
17 .Whitespace
18 [caption='Special syntax {counter:syntax}: ']
19 ====
20 All character codes less or equal to 32 are regarded as "whitespace".
21 ====
22
23 .Rest-of-line comment
24 [caption='Special syntax {counter:syntax}: ']
25 ====
26 The "#" character following whitespace starts a line comment and the
27 rest of the line is ignored. Note that this is also recognised with
28 <<p_lparen,parethesis commenting>>.
29 ====