Home > Language Reference > Statements

Option Warning Statement

Deactivates a compiler warning.

Syntax

Option Warning iWarning

ParameterDescription
iWarningWarning number to be suppressed.

Remarks

This statement tells the compiler to suppress the specifed warning when compiling your project. It should be placed at the beginning of the module and only applies to this module. It is not possible to suppress a warning globally for all the project files.

If the lWarning argument does not correspond to a valid warning message, no warning or error is suppressed. You can refer to the Compiler Warnings page for futher details on available messages.

Note that the only function of this statement is to suppress the display of an unwanted warning message. It does not modify the way in which the project is compiled or how the code is generated.

A possible use of this keyword arises when creating generic user controls that are used in several projects. It is often the case that some properties or methods of the control are never used in a given project which can cause a warning #9010 to be displayed. To avoid this, insert the following line at the beginning of the user control module:

Option Warning 9010

Note that in this specific case, this technique will not interfere with the compiler's optimization routine that removes the dead code. On the other hand, it is not recommended to deactivate the warnings that indicate a probable programming error, for example messages #9003 or 9008.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A