-->
Page 1 of 9

Load another Basic Program

PostPosted: Fri Jan 27, 2017 8:11 am
by flywire
I am trying to put a shell program together. "LOAD: Will load another basic program into memory and start executing it from the beginning." I can see it doesn't return when it is finished which surprises me. Why isn't it running the other program which is in my flash?

Code: Select allprint version()

load "\uploads\blink.bas"

print ip()
print id()

Output:
Code: Select allESP Basic 3.0.Alpha 66
Loading . . . . \uploads\blink.bas
Done...

Re: Load another Basic Program

PostPosted: Fri Jan 27, 2017 10:58 pm
by Mmiscool
Get rid of the leading slash and see if it will exicute then.

Re: Load another Basic Program

PostPosted: Sat Jan 28, 2017 1:31 am
by flywire
Mmiscool wrote:Get rid of the leading slash ...

Same same - blink.bas contains https://www.esp8266basic.com/blink-example.html.

Code: Select all' https://www.esp8266basic.com/blink-example.html

' This will prompt the user to select the pin, blink duration and number of blinks to execute.
'
' GPIO 2 is normally connected to an LED on the nodemcu boards.

​noOfBlinks = 0
pin = 0
blinkDelay = 1000
[top]
print "How many times to blink"
textbox noOfBlinks
print "Pin To use"
textbox pin
print "Blink Delay"
textbox blinkDelay
button "Blink Me Please", [blinkMe]
button "Exit", [getMeOutOfHere]
wait
 
[blinkMe]
for x = 1 to noOfBlinks
  io(po,pin,1)
  delay blinkDelay
  io(po,pin,0)
  delay blinkDelay
next x
wait

[getMeOutOfHere]
end

Edit: Added code.

Re: Load another Basic Program

PostPosted: Sat Jan 28, 2017 6:35 am
by Electroguard
Not sure... but I seem to remember when developing automatic mirrored PRIMARY and SECONDARY chained scripts last year that the filenames were case-sensitive, so it's worth checking that the embedded script filename and actual filename are identical, else it may be ignored as not found.