Using True / False in Application Code
True / False Constants
In VDF 8.2, the symbols True and False can be used consistently throughout an application. The special symbols DFTrue and DFFalse are now considered obsolete and should no longer be used.
Previous revisions of DataFlex placed restrictions on the use of the keywords True and False. These symbols could be used in expressions and messages, but they could not be used in commands. To overcome this limitation, the additional symbols DFTrue and DFFalse were created, which worked properly in commands. For example:
// Prior to 8.2
Move True to bVar // Compiler error. You are supposed to use DFTrue
Move (True) to bVar // This would compile
Send MyMsg True // This would compile
Set_Attribute DF_FILE_IS_SYSTEM_FILE of hFile to True // Compiler error. You are supposed to use DFTrue
Set Property to True // This would compile
This created considerable confusion over the years. It was not clear when these symbols should be used, and it was not clear if DFTrue and DFFalse were actually different from True and False (they were not; True = DFTrue = 1, False = DFFalse = 0).
As of 8.2, all of the above code will compile properly. True and False can and should be used. Anytime you see a reference to DFTrue or DFFalse, you can convert that to True and False.