Skip to Content

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

Estimated Reading Time: 1 Minutes
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.
What should I use for USAGE HANDLE items instead of NULL?

Powered by PHPKB (Knowledge Base Software)