adding the AGAIN control word
[rrq/rrqforth.git] / adoc / p_find.adoc
1 // wordlists.asm:       WORD p_find,'FIND',fasm
2
3 anchor:p_find[]
4
5 === Word: FIND
6 ....
7 Data stack: ( char* n -- [ char* n 0 ]/[ tfa ] )
8 ....
9
10 "FIND" is a function word that searches the current word list search
11 path for the given [n:char*] word, and returns the TFA of the matching
12 word if any. Otherwise FIND preserves the initial data stack but adds
13 0 to it.
14
15 The word is sought starting with the
16 <<p_current_wordlist,CURRENT-WORDLIST>> word list, for the first
17 occurence of a match. If not found, the search continues with the
18 subsequent word list, and so on.
19
20 When a word is found, then the data stack is changed by discarding the
21 [n:char*] double cell string pointer and pushing (only) the TFA of the
22 matching word instead.