Data Sheet
MicroBasic Scripting
204 Advanced Digital Motor Controller User Manual V1.8, August 28, 2017
a = 10
Do
Print(“a = “, a, “\n”)
a--
Loop While a > 0
Print(“Loop ended with a = “, a, “\n”)
• Do...Loop Until Statement
Do
<block>
Loop Until <condition>
Unlike Do...Loop While statement, Do...Loop Until statement exist the loop when
the expression evaluates to true.
a = 10
Do
Print(“a = “, a, “\n”)
a--
Loop Until a = 0
Print(“Loop ended with a = “, a, “\n”)
Terminate Statement
The Terminate statement ends the execution of the program.
Terminate
Exit Statement
The following is the syntax of Exit statement:
Exit { For | While | Do }
An Exit statement transfers execution to the next statement to immediately containing
block statement of the specified kind. If the Exit statement is not contained within the
kind of block specified in the statement, a compile-time error occurs.
The following is an example of how to use Exit statement in While loop:
While a > 0
If b = 0 Then Exit While
End While
Continue Statement
The following is the syntax of Continue statement:
Continue { For | While | Do }
A Continue statement transfers execution to the beginning of immediately containing
block statement of the specified kind. If the Continue statement is not contained within
the kind of block specified in the statement, a compile-time error occurs.