gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [open-cobol-list] RE: Question About Functions


From: Bill Klein
Subject: RE: [open-cobol-list] RE: Question About Functions
Date: Wed May 11 22:01:03 2005

Yes, correct and just to clarify two more cases: 

FUNCTION MAX( A B - C   (- 1))    - 3 parameters
FUNCTION MAX( A B - C   (- D))   - 3 parameters
        while
FUNCTION MAX( A B - (C   - D))   - still 2 parameters

 ***

In other words (in CONFORMING code)

 + or - following "immediately" either an identifier or literal (and
followed by a space) is ALWAYS a binary operator

 + or - following "immediately" (with or without a space) a left parenthesis
and followed by a space is always a unary operator

 + or - NOT followed by a space is a "sign"

FYI,

  identifier1 ( - identifier2:)  *> reference modification
        is a valid use of a unary operator - because the "+" is *not*
preceded (directly) by either an identifier or literal.

 as is
  identifier1 ( - identifier2)  *> subscripting of a *ONE* level element of
an array

while
    identifier1 ( subscript1 - identifier2)  *> subscripting of a *TWO*
level element is NOT valid and would need to be specified as:
    identifier1 ( subscript1 (- identifier2))  



> -----Original Message-----
> From: Roger While [mailto:address@hidden 
> Sent: Wednesday, May 11, 2005 11:35 PM
> To: Bill Klein
> Cc: address@hidden; address@hidden
> Subject: RE: [open-cobol-list] RE: Question About Functions
> 
> OK. To clarify :
> FUNCTION MAX( A B - C   - 1)    - 2 parameters
> FUNCTION MAX( A B - C   -1)     - 3 parameters (-1 is a 
> numeric literal)
> FUNCTION MAX( A B - C   - D)   - 2 parameters
> FUNCTION MAX( A B - C   -D)    - 2 parameters
>     ( This last one is not actually legal and should bring an error or
>        warning depending on dialect )
> 
> Correct Bill ?
> 
> Roger
> 
> 
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]