Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By flywire
#61609 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...
User avatar
By Mmiscool
#61646 Get rid of the leading slash and see if it will exicute then.
User avatar
By flywire
#61649
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.
Last edited by flywire on Sat Feb 04, 2017 6:27 am, edited 1 time in total.
User avatar
By Electroguard
#61654 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.