Start Back Next End
  
ZBasic Language Reference
42
ZBasic Microcontrollers
BasicX Compatibility Note
In BasicX mode, the use of String and Single types is not supported nor is the construction
Is <op> <expr>.  Moreover, there must be at least one standard case clause.
2.5.13 Set Statement
This statement is only allowed as the first statement of a function that returns an UnsignedInteger or
UnsignedLong type.  It must precede all other statements and variable definitions.  It is supported for
compatibility with BasicX and is required in BasicX compatibility mode but it is otherwise ignored.  The
syntax is shown below.
Set <function-name> = New <type>
The <function-name> element must match the name of the function containing the Set statement and
the <type> must match the function’s type.
Example
Function myFunc() as UnsignedInteger
    Set myFunc = New UnsignedInteger
    Dim I as Integer
    <other-statements>
End Function
2.5.14 While-Wend Statement
For compatibility with other dialects of Basic, ZBasic includes support for an alternative to the Do While –
Loop construct.  The syntax is:
While <boolean-expression>
[<statements>]
Wend
Note that this compound statement is logically equivalent to the Do While variation of the Do-Loop
statement.  The one difference is that Exit Do cannot be used to terminate a While-Wend statement.
BasicX Compatibility Note
In BasicX mode, the While-Wend statement is not supported.
2.5.15 With Statement
The With statement allows you to use a shorthand notation to refer to some objects.  The syntax for the
With statement is:
With <prefix>
    <other-statements>
End With
Between, the With and End With statements, any reference to an identifier that begins with a period will
be treated as if it had the series of characters identified by <prefix> immediately preceding the period.
Previous page Top Next page