ZBasic Language Reference
12
ZX Microcontroller Family
Examples
Option StringSize 25
Option StringSize Default
Option Strict
Option Strict [On | Off | Default]
Default: Off
This option directive, supported for BasicX compatibility, enables or disables so-called strict syntax
checking. You can enable strict mode by using Option Strict by itself or by including the keyword
On. You disable strict syntax checking by using Option Strict Off. Specifying Option Strict
Default sets the option to the default for the currently selected language.
The implications of strict syntax checking are noted in the description of each affected element but a
summary of the effects is given here.
-
the loop index variable of a For loop has restrictions on lifetime, visibility and accessibility
-
logical operators like Not, And and Or may not be used with signed integral data types
This option has local scope, i.e., it only affects compilation of the module in which the option appears.
Example
Option Strict Off
Option TargetDevice
Option TargetDevice <device-name>
Default: ZX24
Due to differences between the various members of the ZX- series, the compiler needs to know for which
device it should compile the code. This allows it to generate the correct code for the intended device. At
present, the supported values for <device-name> are ZX24, ZX24a, ZX24n, ZX24p, ZX40, ZX40a,
ZX40n, ZX40p, ZX44, ZX44a, ZX44n, ZX44p, ZX1281, ZX1281n, ZX1280, ZX1280n, ZX24e, ZX24ae,
ZX24ne, ZX24pe, ZX328n, ZX128e, ZX128ne, ZX1281e and ZX1281ne. The device names are not
case sensitive.
Example
Option TargetDevice ZX24a
Option TargetCPU
Option TargetCPU <CPU-type>
Default: ZX24
This option is deprecated, use Option TargetDevice instead.
Option PortPinEncoding
Option PortPinEncoding [On | Off]
Default: see text
When the compiler encounters an I/O port pin designator like C.2 it can convert it to the corresponding
physical pin number for the target device or it can convert it to a composite value whose fields specify the
port and the pin. This directive controls which of these conversions is performed. When the option is off,
the result is a pin number and when it is on the result is the encoded port/pin value. The encoded result