What should I use for USAGE HANDLE items instead of NULL?


Question:

My program uses a lot of USAGE HANDLE items that I set to NULL and check for NULL to mean that the handle has not been created yet.

The compiler gives errors such as the following when I compare a USAGE HANDLE item with NULL in a conditional expression. What should I use instead of NULL? Should I use LOW-VALUE?

--S: Illegal condition IF; file = swlibs\SWMESG.PL, line = 1005, col 4 

Here is an example:
000000 IF CUST-FONT-HANDLE NOT = NULL
000000 MOVE CUST-FONT-HANDLE TO TEXT-FONT-HANDLE
000000 MOVE NULL TO CUST-FONT-HANDLE.
I also get errors on MOVE NULL when the destination item is USAGE HANDLE.

Answer:

The fastest solution is to compile with compiler option -ca.


Article ID: 84
Created: September 2, 2009
Last Updated: September 2, 2009
Author: Support KB Author

Online URL: https://support.veryant.com/phpkb/article.php?id=84