- Sun Feb 05, 2017 6:48 pm
#62111
It appears that the
4Mb build of V66
has a bug preventing loading of files from script, but
the 1Mb build seems ok.
The attached zip contains some demonstration test files for anyone who wishes to test out file loading from script for themselves.
After unzipping them, I suggest you upload file1.bas, file2.bas, file3.bas and file4.txt by going into File Manager and Browsing to each then clicking Upload for each (which puts them into the \uploads\ folder).
Still in File Manager I suggest you select \default.bas then click Edit, then paste and Save the contents of the supplied default.bas file (so it is saved into \). The attached pic shows what you should see in File Manager.
I've also embedded default.bas and file1.bas (the others are similar to file1.bas but with an appropriate name change).
When you run the supplied default.bat file it does an initial memclear then allows selection and load of any of the test files.
Each time a file is 'loaded', a file counter is incremented, which shows that
vars are being inherited by subsequently loaded files.
I repeat that this works fine on the 1Mb build, but causes the ESP to crash and reboot on the 4Mb build.
Notice that file4.txt also loads and runs ok, showing that basic scripts don't necessarilly require .bas extension.
http://www.electroguard.eu/workshop/LoadFiles.zip Code: Select allmemclear
filen = "/default.bas"
html "Filename=" & filen & "<br>"
fileloads = 0
dropdown filen, "file1.bas,file2.bas,file3.bas,file4.txt"
button "Load filename",[LOADFILE]
wait
[LOADFILE]
filen = "/uploads/" & filen
load filen
print "This should not show because the selected file should load and run first"
wait
Code: Select allfilen = "file1.bas"
fileloads = fileloads + 1
html "<br>Filename=" & filen & ", file loads=" & fileloads & "<br>"
dropdown filen, "file1.bas,file2.bas,file3.bas,file4.txt"
button "Load filename", [LOADFILE]
wait
[LOADFILE]
filen = "/uploads/" & filen
load filen
print "This should not show because the selected file should load and run first"
wait