How do i create a loop using MSX BASIC?

Page 1/4
| 2 | 3 | 4

By minus_signs

Rookie (17)

minus_signs's picture

20-09-2003, 09:34

I tried WHILE...WEND and DO...LOOP but they both don't work (I get a syntax error when it reaches the LOOP or the WEND command)

Login or register to post comments

By Latok

msx guru (3873)

Latok's picture

20-09-2003, 09:39

10 For I = 0 to 200
20 [action]
.
.
.
100 next I

In this fornext-loop, [action] is being executed 201 times.

10 Print "MSX Resource Center"
20 goto 10

This is an endless loop

10 gosub 40
20 print "Is cool"
30 end
40 print "MSX Resource Center"
50 Return

And this is a relative jump....Uh, no loop Tongue

By minus_signs

Rookie (17)

minus_signs's picture

20-09-2003, 10:05

i already knew those, but they look so ugly (except for the FOR but i need somethin gelse because i want to do things like WHLE NOT EOF (1):...WEND)
so there is no way to do loops except for simulating them by using IF, GOTO and GOSUB?

what a rotten BASIC!
oh well, i expected something like this to happen, after all it's still Microsoft

By SjaaQ

Champion (272)

SjaaQ's picture

20-09-2003, 10:53

Yeah there is, but you still need the command "GOTO"

10 i=0 ' initialize
20 'Do
30 'do the loop instructions
40 if i<5 then goto 20 'Loop while i<5

By wolf_

Ambassador_ (9979)

wolf_'s picture

20-09-2003, 11:09

Rotton ? well, what did you expect? these machines are 15..20 yrs old!

By Haze

Master (147)

Haze's picture

20-09-2003, 13:08

i already knew those, but they look so ugly ...

I'd say give NestorPreTer (www.konamiman.com/msx/msx-e.html#nestorpreter) a try. Should "de-clutter" your sources once you get the hang of it. :P
And while you're at it, don't forget to use NestorBASIC. ;)

By anonymous

incognito ergo sum (116)

anonymous's picture

20-09-2003, 13:57

WHILE/WEND and DO/LOOP are PASCAL statements. They have migrated to some of the more recent BASIC dialects, like QBASIC, but MSX-BASIC doesn't have them yet.

While using line-numbers and 2-character variables may seem old-fashioned to you now, in it's day, MSX-BASIC was the most advanced BASIC available. And it still beats modern BASIC's in some areas.

By wolf_

Ambassador_ (9979)

wolf_'s picture

20-09-2003, 14:34

hm.. I beg to differ Smile

By anonymous

incognito ergo sum (116)

anonymous's picture

20-09-2003, 20:03

hm.. I beg to differ Smile
I know that's your new favourite sentence, but I'll bite anyway. Why? Smile

By wolf_

Ambassador_ (9979)

wolf_'s picture

20-09-2003, 22:09

Why, well .. did you take a look at the specs of blitzbasic (blitz2d, blit3d or blitz+ (win GUI style) ?

I wouldn't want to change a single feature with the msx-basic version, for sure there are some features that you miss in some new basic dialects, but not in ALL new basic dialects for sure.

By anonymous

incognito ergo sum (116)

anonymous's picture

20-09-2003, 22:18

Sorry to burst your bubble, but regardless how great blitzbasic is, it's DEFINITELY not BASIC.
Even the creater himself calls it a BASIC and C hybrid.

Page 1/4
| 2 | 3 | 4