Stefan Tageson | 7 Jan 20:40 2010
Picon

How to test for *null *ptr in CL?

Hello!
Struggling with a CL-program where I need to test a variable defined as *PTR type for a *null value.
DCL        VAR(&LP) TYPE(*PTR)

IF         COND(&LP *EQ *NULL) THEN(DO)
Gives me a compiler error:
* CPD0711 30  Operands in expression not same type.

Anybody know what to do?

Regards

Stefan Tageson
AddconIT AB
S:t Gertrudsgatan 3, SE-211 25 Malmö, Sweden
Cell :     +46 (0) 732 36 99 34
stefan.tageson@...<mailto:stefan.tageson@...>

http://www.addconit.se/
--

-------------------- Internet e-Mail Disclaimer --------------------
This e-mail and any files transmitted with it are confidential and intended solely for the use of the
individual or entity to whom they are addressed. If you are not the intended recipient you are notified
that any use, disclosure, copying or distribution of the information is prohibited. In such case, you
should destroy this message and kindly notify the sender by reply e-mail.The views expressed in this
e-mail and any attachments are personal and, unless stated explicitly, do not represent the views of
AddconIT. Furthermore, AddconIT will not be bound by this e-mail.

--

-- 
(Continue reading)

Scott Klement | 7 Jan 21:07 2010

Re: How to test for *null *ptr in CL?

Make sure you are up-to-date on PTFs, as there were bugs in this support 
when V5R4 was first released.

then, simply declare a pointer variable in CL.  By default, new pointer 
variables are set to NULL.  Use that new variable to compare with... for 
example:

    DCL VAR(&LP) TYPE(*PTR)
    DCL VAR(&NULLPTR) TYPE(*PTR)

    IF  COND(&LP *EQ &NULLPTR) THEN(DO)

Stefan Tageson wrote:
> Hello!
> Struggling with a CL-program where I need to test a variable defined as *PTR type for a *null value.
> DCL        VAR(&LP) TYPE(*PTR)
> 
> IF         COND(&LP *EQ *NULL) THEN(DO)
> Gives me a compiler error:
> * CPD0711 30  Operands in expression not same type.
> 
> Anybody know what to do?
> 
> Regards
> 
> Stefan Tageson
> AddconIT AB
> S:t Gertrudsgatan 3, SE-211 25 Malmö, Sweden
> Cell :     +46 (0) 732 36 99 34
> stefan.tageson@...<mailto:stefan.tageson@...>
(Continue reading)

Stefan Tageson | 7 Jan 21:47 2010
Picon

RE: How to test for *null *ptr in CL?

> -----Original Message-----
> From: midrange-l-bounces@... [mailto:midrange-l-
> bounces@...] On Behalf Of Scott Klement
> Sent: Thursday, January 07, 2010 9:07 PM
> To: Midrange Systems Technical Discussion
> Subject: Re: How to test for *null *ptr in CL?
> 
> Make sure you are up-to-date on PTFs, as there were bugs in this
> support
> when V5R4 was first released.
> 
> then, simply declare a pointer variable in CL.  By default, new pointer
> variables are set to NULL.  Use that new variable to compare with...
> for
> example:
> 
>     DCL VAR(&LP) TYPE(*PTR)
>     DCL VAR(&NULLPTR) TYPE(*PTR)
> 
>     IF  COND(&LP *EQ &NULLPTR) THEN(DO)
> 

Perfect! Worked great. Thank you.
--

-- 
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@...
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@...
Before posting, please take a moment to review the archives
(Continue reading)


Gmane