How to test a pointer?
Posted: Thu Nov 19, 2015 6:59 am
I am new to PLI and I beg your indulgence for a simple question.
I am modifying an existing program. It already has a local option to display the program parameters. The result for the parameter in question is:
Then I assign the parameter value to a local variable:
The compiler does not like this:
It complains about comparing a pointer to a character (or something like that)
In the same program, I found the use of NULL(), but when I use it:
it seems to be true in the 'ff000000'x case. How am I supposed to test the pointer so as not to use it if it has not been set?
I am modifying an existing program. It already has a local option to display the program parameters. The result for the parameter in question is:
PARMS.myvar_PTR='FF000000'bx;
Then I assign the parameter value to a local variable:
Dcl myvar_ptr Ptr;
myvar_ptr = parms.myvar_ptr;
myvar_ptr = parms.myvar_ptr;
The compiler does not like this:
If (myvar_ptr ¬= 'FF000000'x) Then
It complains about comparing a pointer to a character (or something like that)
In the same program, I found the use of NULL(), but when I use it:
If (myvar_ptr ¬= Null() ) Then
Call mysub
Call mysub
it seems to be true in the 'ff000000'x case. How am I supposed to test the pointer so as not to use it if it has not been set?