Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By Oldbod
#62011 Well this is interesting. I've tinkered a bit and now seem to have exactly the same issue as you were experiencing. I'll try to find some time to play a bit to see if I can get some consistency into this.
User avatar
By flywire
#62012 Same for me. Sometimes these programs work and other times they get stuck loading the program.

I've tried reset and cycling the power but it doesn't seem to make much difference. Once they get stuck I can't seem to get them loading again and the chrome browser session fails more often. I notice that sometimes the first line after any comment lines and a blank line has about three strange characters added to the start of it.

Perhaps the file space is being corrupted. I am having similar problems with other parts that load files such as the CSS example.

I don't know why load seems to clear the screen without a text box and I'd like to see the initial program continue when the loaded program ends.

Again, more documentation would be useful. It needs to be in an open wiki so we can maintain it ourselves as problems occur. eg The slashes run the opposite ways between the language reference for load and the file manager display.

load.bas
Code: Select allmemclear
print version()
print id()

' goto [Loadit]    ' if line executes loading program output not seen
print ""
button "Load", [Loadit]
wait

[Loadit]
load "/toggle.bas"
wait

print ip()
end

blink.bas
Code: Select allpin = 2
noOfBlinks = 3
blinkDelay = 1000

print "Pin To use "
textbox pin

print "How many blinks "
textbox noOfBlinks

print "Blink Delay "
textbox blinkDelay

print ""
button "Blink Me", [blinkMe]
button "Exit", [getMeOutOfHere]
wait

[blinkMe]
for x = 1 to noOfBlinks
  io(po,pin,0)
  delay blinkDelay
  io(po,pin,1)
  delay blinkDelay
next x
wait

[getMeOutOfHere]
end


Image
User avatar
By flywire
#62036 A couple more observations.

* After loading and running a program the last run program comes up in the editor.
* After an initial run of the loader program the interpreter seems to go straight to running the load (second) program (rather than the one you just saved in the edit screen). It could be that the memclear is not clearing the button response or there is a clear screen before running the loaded program.
Oldbod wrote:... If still having issues, may be worth checking that if you uploaded a file rather than doing an "edit paste save" to create your basic program it has the right terminators

I'm not exactly clear on the above instruction but I understand that if you save a program in the editor, getting the saved message from the webpage and saved at the bottom of the editor, then run will run the program you just saved.