CompilerLevelWarning
Purpose
Control how strict Compiler Warnings should be.
Unlike compiler errors, compiler warnings are not fatal to compilation but allow the addition of informative messages for developers.
Syntax
CompilerLevelWarning {option} {On|Off}
Where {option} is one of:
- AmbiguousFunctions - Raises warnings when a function with the same name is defined multiple times but uses different return types.
- General - Raises warnings when various obsolete classes, commands, or techniques are used.
- IfExp - Raises warnings when if/else/case uses old style “if x eq y” type of syntax instead of “if (x=y)”.
- Item - Raises warnings when the Item keyword is used. It is never needed, but there is nothing wrong with using it.
- IfLine - Raises warnings when If/else/case is used in a single line.
- Unicode - Raises warnings when commands that are not Unicode safe are used.
-
All - Turns all warnings on. If you want the strictest warnings, just add this line to the top of your code:
CompilerLevelWarning All On
What It Does
This command gives you control over how strict your warning checking should be. By default, these are all off. Not all compiler warnings are optional like this – only the ones that are high overhead, falling on the “picky, picky” side or more a matter of programming preference.
See Also
- CompilerWarnings controls the compiler warnings system.
- The #Warning compiler directive allows the addition of a compiler warning to code.
Notes
The Item keyword was required in older versions of DataFlex but is no longer needed and can be safely omitted.
Example
Set Value of oDbForm1 Item 0 to "Test"
should now be written as:
Set Value of oDbForm1 to "Test"
Example
Some properties still require an item number, but no longer the item keyword:
Set Prompt_Object of oDbForm1 Item 0 to oMyPromptObject
should now be written as:
Set Prompt_Object of oDbForm1 0 to oMyPromptObject