gnucobol-users
[Top][All Lists]
Advanced

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

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


From: Roger While
Subject: [open-cobol-list] Re: Question About Functions
Date: Mon May 9 22:02:32 2005

In so far that a specific function allows it, arithmetic and boolean expressions
are legal.

In fact you also can nest functions eg. from 2002 standard
syntax rules :

-- quote --
If a function's definition permits arguments and a left parenthesis immediately follows function-prototypename- 1 or intrinsic-function-name-1, the left parenthesis is always treated as the left parenthesis of that
function's arguments.
NOTE For a function that may be referenced either with or without arguments, such as the RANDOM function, careful coding is necessary to ensure correct interpretation. For example, in the following:
FUNCTION MAX (FUNCTION RANDOM (A) B)
'A' is treated as an argument to the RANDOM function. If 'A' is instead meant to be a second argument to the MAX
function, different coding is necessary - either:
FUNCTION MAX ( (FUNCTION RANDOM) (A) B)
or
FUNCTION MAX (FUNCTION RANDOM () A B)
or
FUNCTION MAX (FUNCTION RANDOM A B).
-- end quote --

Roger





reply via email to

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