[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [open-cobol-list] Re: NULL and EVALUATE
From: |
Bill Klein |
Subject: |
RE: [open-cobol-list] Re: NULL and EVALUATE |
Date: |
Mon Dec 6 11:38:04 2004 |
Yes, not and medium <G> ....
I am in the process of having some discussions with J4 on this issue. You
are correct (and I was wrong) that the '02 definitions of NULL (and they do
NOT allow NULLS - as IBM and MF do) is an identifier. Therefore, it might
be valid as a selction subject or object.
HOWEVER, SR(1) on page 98 states,
"1) This format may be used only as a sending operand in an INITIALIZE or a
SET statement; as an argument in a program-prototype format CALL statement,
a function-prototype format function activation, or a method invocation; or
in a data-pointer or program-pointer relation-condition."
So the questin is whether use in a selection-object / selection-subject is
or is not a "relation-condition".
GR(4a6) on page 144 says
"6. If the selection object is identifier-2, literal-2,
arithmetic-expression-2, or boolean-expression-2, the pair is considered to
be a conditional expression of the following form:
selection-subject [NOT] = selection-object
where 'NOT' is present if it is present in the selection object. The result
of the analysis is the truth value of the resulting conditional expression."
but NORMALLY a GR doesn't override (clarify) a Syntax Rule.
***
Bottom-Line: (on this issue)
Is that as long as you are doing an '85 Standard compiler with an
EXTENSION, then you probably could/should allow
EVALUATE NULL *> or NULLS)
When Pointer-data-item
but there is still a question for the '02 Standard.
***
Also of interest (and I have clarified this) is the fact that the '02
Standard
A) does NOT allow NULL (nulls) in a VALUE clause
B) *always* initializes a pointer data item to "NULL"
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Roger While
> Sent: Monday, December 06, 2004 3:07 AM
> To: address@hidden
> Cc: address@hidden
> Subject: [open-cobol-list] Re: NULL and EVALUATE
>
> Bill, I don't think I agree here.
> The definitions at 96/98 are under section 8.4.2 - Identifiers.
> This satisfies one of the conditions for the subject of an EVALUATE.
> The SR "in a data-pointer or program-pointer relation condition"
> says we can compare it, so I would interpret this as meaning it
> is perfectly valid as a subject of the EVALUATE.
>
> Roger
>
>
>
> >>First, I was in error (in an earlier post) when I indicated
> that "NULL"
> >>was
> >>a figurative constant. This may (or may not) be true for
> some extension
> >>to
> >>the '85 Standard - but it is NOT true for the '02 Standard.
> >>
> >>Rather it is defined as "8.4.2.10 Predefined-address" (see page 98)
> >> and/or
> >> "predefined object reference" (see page 96)
> >>
> >>NEITHER of these is valid as the "Selection-subject" in an EVALUATE
> >>statement.
> >>
> >>See for example SR(1) on page 98 (for the NULL address)
> >>
> >>"1) This format may be used only as a sending operand in an
> INITIALIZE or
> >>a
> >>SET statement; as an argument in a program-prototype format CALL
> >>statement,
> >>a function-prototype format function activation, or a
> method invocation;
> >>or
> >>in a data-pointer or program-pointer relation-condition."
> >>
> >> ***
>
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from
> real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
> https://lists.sourceforge.net/lists/listinfo/open-cobol-list
>