hello, good day.
why does the loop automatically with gosub and sub ?
thanks.
greetings
--------------------------------------
SCREEN 128
StartEdit:
Loop:
Key$=GET
if Key$="D" then g = 129 : test()
Goto loop
end
sub test()
print "HALLO"
end sub
---------------------------------------
--------------------------------------
SCREEN 128
StartEdit:
Loop:
Key$=GET
if Key$="D" then g = 129 : gosub test
Goto loop
end
test:
print "HALLO"
return
---------------------------------------
it is ok without g = 129
--------------------------------------
SCREEN 128
StartEdit:
Loop:
Key$=GET
if Key$="D" then gosub test
Goto loop
end
test:
print "HALLO"
return
--------------------------------------
nxtbasic : this loop runs automatically
nxtbasic : this loop runs automatically
- Attachments
-
- Bild1.jpg (10.57 KiB) Viewed 982 times
-
- nofehler.jpg (5.84 KiB) Viewed 982 times
Re: nxtbasic : this loop runs automatically
It's a bug It will be fixed with the next version of nxtBasic.
To workarround the bug, you can avoid putting commands on the same line as the IF-statement. So This will work:
To workarround the bug, you can avoid putting commands on the same line as the IF-statement. So This will work:
Code: Select all
SCREEN 128
StartEdit:
Loop:
Key$=GET
if Key$="D" then
g = 129 : gosub test
end if
Goto loop
end
test:
print "HALLO"
return
Re: nxtbasic : this loop runs automatically
hello, thanks for the help.
can you please remove this in screen 128 as well?
greetings
can you please remove this in screen 128 as well?
greetings
- Attachments
-
- fehler11.jpg (6.09 KiB) Viewed 936 times
Re: nxtbasic : this loop runs automatically
It's only visible when the bitmap layer is visible (screen 128). So yes, it will be gone soon