Author
| How do i create a loop using MSX BASIC?
|
[D-Tail]
 msx guru Posts: 3131 | Posted: March 30 2006, 01:02   |
Talking about useless code obfuscation  |
|
AuroraMSX
 msx master Posts: 1383 | Posted: March 30 2006, 13:04   |
But it's faster than the IF/THEN/ELSE construct
[edit] (or is it?) [/edit] |
|
manuel msx legend Posts: 4321 | Posted: March 31 2006, 14:45   |
It's also necessary for one-liners.  |
|
NYYRIKKI msx master Posts: 1805 | Posted: March 31 2006, 23:26   |
Nah, that is not obfuscation... how about this:
1 loop=5
2 ONERRORGOTO2:POKE-2373,0
3 loop=LO-1
4 ' Do all the fun things here.
5 if lollipop > mouth then we must be happy!
|
|
[D-Tail]
 msx guru Posts: 3131 | Posted: April 02 2006, 11:14   |
NYYRIKKI: what's that poke actually doing?
|
|
BiFi msx guru Posts: 3142 | Posted: April 02 2006, 16:49   |
LOL... nifty trick there again, NYYRIKKI.
[D-Tail]: [hint]convert that address to a 16-bit hexadecimal value and look it up in some system variables list[/hint]  |
|
NYYRIKKI msx master Posts: 1805 | Posted: April 02 2006, 19:03   |
That poke makes sure, that we are not in error handler to avoid error message.
BTW this code does not seem to work. It seems, that mouth is not big enough, so... to correct this problem, you must change mouth to head in line 5.  |
|
manuel msx legend Posts: 4321 | Posted: April 02 2006, 22:23   |
What's the program supposed to do anyway? I doesn't do much here. With mouth it hangs (probably repeating errors) and with head it just finishes. That's probably the idea: it finishes while it has some utter crap in it  |
|
NYYRIKKI msx master Posts: 1805 | Posted: April 03 2006, 00:25   |
manuel: This is not a program. This is just one possible solution to question: "How do i create a loop using MSX BASIC?" Maybe not the most obvious one, but solution anyway...
|
|
|
|
|