\ File1.txt
-testing \ not OK in all FORTHs
marker -testing \ not OK in all FORTHs
\ log Starting a demo of several nested include calls
: file1Aword ;
\ include "file2.txt"
: file1Bword ;
: file1Cword ;
\ File2.txt
:file2Aword ;
#include <file3.txt>
: file2Bword ;
: file2Cword ;
#include file4.txt
: file2Dword ;
\ File3.txt
: file3Aword ;
: file3Bword ;
: file3Cword ;
\ EOF
: file3Dword \ not to be seen! ;
\ File4.txt
: file4Aword ;
: file4Bword ;
\ include "file5.txt"
: file4Cword ;
: file4Dword ;
\ File5.txt
: file5Aword ;
: file5Bword ;
: file5Cword ;
\ log End of File 5 reached :-)
MyFORTHshell now accepts several handy directives: include and eof and log
in several formats, allowing you to nest the transmission of multiple source files to the MCU.
The include directive can e.g. be used in a source file like this:
\ include "strings.txt"
See the content of 5 files used for testing of "nesting".
This directive must be placed after "\" which marks the beginning of a FORTH comment.
MyFFshell will detect this as a directive, and will open this new file and transmit its content to the ARDUINO/Scamp2/ESP32... card.
OBS (NEW from ver. 3.6+) - New Include and EOF directives added:
#include strings.txt
#include d:\mydir\strings.txt
#include "strings.txt"
#include <d:\mydir\strings.txt>
OBS (NEW from ver. 4.1+) - ESP32Forth INCLUDE and EOF directives added:
( include "strings.txt" )
( include <strings.txt> )
Appears as comment lines in ESP32Forth
\ include "file" also works on ESP32Forth as this is seen as a "comment" too.
File [drive\path\] name.ext can be enclosed between
two spaces _
two "
or between one '<' and '>'
OBS: include calls can be nested!
MyFORTHshell will ensure that same source file is not uploaded more than once, if a file accidently is included more than once, in the same upload session! :-)
The EOF (end of file) directive is detected by MyFORTHshell, which will interrupt the transmission of the file being transmitted, and goes up in the file call hierarchy.
\ eof ( note the space!)
\ EOF ( note the space!)
#eof
#EOF
( the EOF's above are for FlashForth! - for ESP32Forth, see below:)
( eof ) ( ESP32Forth - note the space " " after the "(" )
( EOF ) ( ESP32Forth - note the space " " after the "(")
All shown directives are case IN-sensitive!
So e.g.:
\ INCLUDE "STRINGS.txt"
#Eof
will be valid too.
Yet another new directive has been added, the \ log or \ LOG directive:
\ LOG This is a test of nesting INCLUDE files
\ log Test log line 2 w. "log"in lower case
This line of text wil show up only in MyFFshell's LOG window.
You can download a ZIP file with the 5 test files (File1...5.txt)
Place them in same DIR as your MyFFshell.exe
https://www.dropbox.com/s/lnrz0bph364mdzs/Test%20File%201%20to%205.zip?dl=0
Open File1.txt in the Source File window and send it to your MCU/Arduino/Scamp2/ESP32...