![]() ZBasic Language Reference
19
ZBasic Microcontrollers
Example
Option Overload
Option Namespaces
Default: none
This option enables the definition of namespaces. It may be used in any module and its occurrence
enables the definition of namespaces in that module and all subsequently processed modules.
Nevertheless, it is generally advisable to place it in the first module compiled. When this option is used,
the identifier Namespace becomes a keyword and cannot be used as a procedure or variable name.
Example
Option Namespaces
Option NameStyle <name-style>
Default: C
This option can be used to change the allowable format of a ZBasic identifer. There are two supported
name styles, Basic and c. Under the Basic name style, an identifier must begin with an alphabetic
character and thereafter contain only alphabetic and numeric characters and underscores. With the c
name style, the rules are expanded to allow an identifer begin with an underscore. Th C name style is
supported primarily to allow accessing procedures and variables in code written in C and/or assembly
language where the names might begin with an underscore.
Example
Option NameStyle Basic
Option CodeType <code-type>
Default: C
This option, available only when compiling for native mode devices, specifies the type of intermediate
code to generate corresponding to the ZBasic application which is then converted to target processor
instructions by the back-end compiler. The default is to generate C code but in some cases, it may be
useful to direct the ZBasic compiler to generate C++ code by specifying the <code-type> as C++ or CPP.
Example
Option CodeType C++
Option Library "<object-library-filename>"
Default: none
This option, which can only be used for native mode devices, specifies the name of an object library that
should be linked in when the executable is built. Typically, this directive will appear in a declarations file
that identifies the public entities contained in the library. If the specified filename does not have a path
prefix, it is assumed that the specified name is relative to the directory of the module containing the
directive.
This option may be used in multiple modules as needed.
|