Author
| How do i create a loop using MSX BASIC?
|
------ msx novice Posts: 18 | Posted: September 20 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)
|
|
Latok msx master Posts: 1891 | Posted: September 20 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  |
|
------ msx novice Posts: 18 | Posted: September 20 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
|
|
SjaaQ msx novice Posts: 26 | Posted: September 20 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
|
|
wolf_ online
 msx legend Posts: 5179 | Posted: September 20 2003, 11:09   |
Rotton ? well, what did you expect? these machines are 15..20 yrs old!
|
|
Haze msx user Posts: 49 | Posted: September 20 2003, 13:08   |
Quote:
| 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. 
And while you're at it, don't forget to use NestorBASIC.  |
|
GuyveR800 msx guru Posts: 3048 | Posted: September 20 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.
|
|
wolf_ online
 msx legend Posts: 5179 | Posted: September 20 2003, 14:34   |
hm.. I beg to differ  |
|
GuyveR800 msx guru Posts: 3048 | Posted: September 20 2003, 20:03   |
Quote:
| hm.. I beg to differ 
|
I know that's your new favourite sentence, but I'll bite anyway. Why?  |
|
wolf_ online
 msx legend Posts: 5179 | Posted: September 20 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.
|
|
GuyveR800 msx guru Posts: 3048 | Posted: September 20 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.
|
|
sjoerd msx addict Posts: 457 | Posted: September 20 2003, 22:55   |
Quote:
| 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.
|
So when a language beats msx-basic it is not basic anymore. |
|
wolf_ online
 msx legend Posts: 5179 | Posted: September 20 2003, 22:57   |
He calls it that a basic/c hybrid because BB has some things that the classic basics don't have (block IF's, select cases, functions, while loops etc.). But QBasic also had all these additions.
I'd call BB, the (yet to be released) BlitzMax in this case, a hybride as soon as it supports OOP, (classes, function pointers etc.).
Where do you define the border between basic and non-basic ?
Does 'basic' equal linenumbers and gotos ? And does 'basic' equal single-line IF's, and just gosubs to define subroutines?
|
|
sjoerd msx addict Posts: 457 | Posted: September 21 2003, 00:02   |
I don't know how to decide what's basic or what's not. Visual Basic doesn't look that basic to me either. Let's call something basic when it's called basic. So blitzbasic is still a basic-dialect. Modern basics are more pascal-like than basic-like anyway.
|
|
Necron msx lover Posts: 113 | Posted: September 21 2003, 00:32   |
While wend is not from Pascal...
is Pascal its while, begin / end
 |
|
|
|
|