47 of 208
ZBasic Language Reference 39 ZX Microcontroller Family 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. Example tick = Register.RTCTick ' the long way With Register <other-statements> tick = .RTCTick ' the short way, implies Register.RTCTick <other-statements> End With Note that the entire construct, from With to End With, is treated much like a compound statement in that it cannot be split across other statement boundaries. It is important to note, however, that this is not a true compound statement with block scoping. Variables and constants defined within a With block are visible to statements that follow it. In addition to Register, other useful <prefix> designations are Console, Debug, Option, Version and Module. Also, the <prefix> may specify a portion of a structure member reference, allowing shorthand access to structure members. See Section 3.25 for more information on using structures. BasicX Compatibility Note In BasicX compatibility mode, only With Register is supported. 2.6 Literals Boolean, numeric and string constant values are often used in programming. These are called literals because the represent the literal value of the number or string that you have in mind as opposed to a variable whose value may change over time. 2.6.1 Boolean Literals Boolean literals are the keywords true and false, in upper, lower or mixed case. These literals are of type Boolean.