Page 21 of 229 Start Back Next End ZBasic Language Reference 11 ZBasic Microcontrollers existing modules written for BasicX. In most cases, existing BasicX code will compile correctly in ZBasic mode with few, if any, changes. If you need to utilize BasicX compatibility mode you should be aware that none of the enhanced language features nor any of the enhanced System Library routines of ZBasic will be available in that module. Also, using Option Language BasicX changes the defaults for some of the other options as listed in the table below. You may still change the prevailing setting of these other options by utilizing the related option directive either before or after this option directive. Option Directive Default for BasicX Default for ZBasic Strict On Off AllocStr Off On This option has local scope, i.e., it only affects compilation of the module in which the option appears. Option AllocStr Option AllocStr [On | Off | Default] Default: On By default, native compilation mode uses an allocation strategy for strings called dynamic string allocation. In contrast, BasicX uses an allocation strategy called static allocation. This option directive allows you to select the dynamic allocation strategy (Option AllocStr On) or the BasicX-compatible static allocation strategy (Option AllocStr Off). Specifying Option AllocStr Default sets the option to the default for the currently selected language. If neither On, Off nor Default is specified, the value On is assumed. See Section 3.28.2 for more information on the two allocation strategies. This option has local scope, i.e., it only affects string variables defined in the same module in which the option appears. Examples Option AllocStr Option AllocStr Off Option StringSize Option StringSize {<value> | Default} Default: 20 When string variables are defined, space to hold the characters of the string is allocated either statically or dynamically (see Option AllocStr, above). When the space is statically allocated a fixed number of bytes of space is set aside for the string at compile-time thus setting the maximum size of that string. This option specifies the number of characters that should be reserved for statically allocated string storage. See the description of the Option AllocStr directive for more information about dynamically allocated string storage. If Option StringSize Default is specified the default value for the string size is used. This is useful if the string size was set using a command line option and you want to restore it to the default for this particular module. The maximum allowable string size is 255. This option has local scope, i.e., it only affects string variables defined in the same module in which the option appears. Examples Option StringSize 25 Option StringSize Default