various improvements
[rrq/rrqforth.git] / adoc / p_load_file.adoc
1 // compile.asm: WORD p_load_file,'LOAD-FILE'
2
3 anchor:p_load_file[]
4
5 === Word: LOAD-FILE
6
7 ....
8 data stack: ( chaz* -- * 0/1 )
9 ....
10
11 "LOAD-FILE" is a function word that evaluates a text file. It opens a
12 file via xref:p_open_file[OPEN-FILE] and sets up a stream with a
13 buffer of <<p_load_buffer_size,LOAD-BUFFER-SIZE>> bytes for
14 reading it. The stream is passed to
15 <<p_evaluate_stream,EVALUATE-STREAM>> for processing its words. Upon
16 its return the file is closed and the stream memory is reclaimed, and
17 then the function returns whatever
18 <<p_evaluate_stream,EVALUATE-STREAM>> returns.