Back to top

AKD BASIC GOTO Statement Example

'-------------- Device Params -----------------------

Params

End Params

'-------------- Define (dim) Global Variables --------

Dim X as integer

'-------------- Main Program -------------------------

Main

  'Program counts to 10

X=0

Start_Loop:             'Label Start_LOOP

x = x + 1                ' Add 1 to X

print X                  ' Print X value

if x < 10 then         ' If X < 10 continue the loop

goto Start_Loop      ' Return to Label Start_Loop

End If

End Main

'-------------- Subroutines and Functions ------------

'-------------- Interrupt Routines -------------------