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

Question ID : 84
Created on 2009-09-02 at 1:54 PM
Author : Veryant Support [support@veryant.com]

Online URL : http://support.veryant.com/support/phpkb/question.php?ID=84



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 = swlibsSWMESG.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.


Back to Original Question