Start Back Next End
  
ZBasic Language Reference
160
ZBasic Microcontrollers
This option defines an identifier that may be used in a conditional construct (see Section 3.9).  If no value
is specified, the identifier is considered to be an integral identifier and is assigned the value 1.  The value
may be specified as a decimal value or, when prefixed by &H or 0, as a hexadecimal value.  Otherwise,
the value is considered to be a string value.  The string value may optionally be enclosed in matching
quote marks or apostrophes but this is only necessary if the value contains white space or begins with a
character sequence that would otherwise indicate that an integral value is being specified. Note that
depending on your operating system, using the ampersand or other special characters on the command
line may require special quoting or escape characters. 
If the identifier already exists, an error message will be displayed.  The –U option may be used to avoid
this situation.  Also note that identifiers defined in this fashion are also available to be used in program
code somewhat as if they were defined by a Const definition.  The primary difference is that integral
valued identifiers have a universal type that can be used just like a literal integral value.
Identifiers defined by this means are visible in all modules processed after the appearance of the option. 
Note that within a particular module the identifier may be undefined and re-defined.  However, this has
effect only within that particular module; the remaining modules will see the value as originally defined.
-U<id>
This option causes the compiler to remove the specified identifier (as defined by –D) from the internal
symbol table if the identifier exists.  If the identifier doesn’t exist, the option is silently ignored.
10.3 Error and Warning Messages
The compiler will output messages for detected error conditions and warnings to stderr (by default, the
console).  The message output may be redirected to a file using the I/O redirection capabilities of the
operating system or by using a compiler option to specify the error output file (see –-error above). 
Error messages relating to problems with compiler options will not be affected by the presence of the
error output specification.
For code-related errors and warnings, the message will contain a reference to the filename and line
number of the code corresponding to the error or warning.  Although the line number given will generally
be correct, code involving line continuations may lead to the line number reported being different than the
actual physical line number where the offending code appears.
The general format of the error and warning messages may be modified to some extent using the –-
error-format option described in the preceding section.  This may be useful if you are using the
compiler with a different IDE that expects to see error message is a slightly different format for its “jump to
the next error” function.
10.3.1 Controlling Warnings
The types of warnings that the compiler will issue may be controlled from the command line using the --
warn option.  Most of the warning types are enabled by default.  It is desirable in some cases to allow the
compiler to generate a certain type of warning message except for specific code sequences.  This can be
accomplished using the #pragma warning compiler directive in your program, the syntax of which is
shown below.
Previous page Top Next page