I agree with
tsh73...
There are times where speed is an issue and you can use Goto statments for speed in place of loops...
But GOTO was one of the original commands from the Line Number Days (ughhh...)...
Since then, there have been new loops added, such as DO:LOOP
And SUBs and FUNCTIONs are much easier to deal with and seperate global and local variables than GOTO/GOSUB statements...
Basically Nothing is evil or good in Basic Syntax...
The trick is to KNOW when and where to use what...
You don't want to use the same commands and methods every where...
And knowing that comes with practice and experience...
Another context effective set of commands are...
Select Case:Case:Case Else:End Select
and
If Then:Else:End If
Say you use
A$ = Inkey$ to trap a Key...
you might use
If Then Else if you only have one key to watch for...
A$ = Inkey$
If A$ = Chr$(27) Then End
You Might Use Select Case in places where you check for multiple keys...
A$ = Inkey$
Select Case A$
Case "A"
Print "A"
Case "B"
Print "B"
Case ""
Case else
Print "NOT A or B"
end select
And in some cases you might use an equation in place of a if then / case select...
If A$=Chr$(0) + Chr$(72) then Y = Y - 5
If A$=Chr$(0) + Chr$(80) then Y = Y + 5
Can be replaced with this...
Y = Y + (-5 * (A$ = Chr$(0) + Chr$(72)))
Y = Y - (-5 * (A$ = Chr$(0) + Chr$(80)))
Then simplified to...
Y = Y - 5 * (A$ = Chr$(0) + Chr$(72))
Y = Y + 5 * (A$ = Chr$(0) + Chr$(80))
Good Luck
Have Fun, Be Young... Code BASIC
-Josh Stribling