BUILT-IN FUNCTION SYNTAX


Built-in functions must begin with a % (percent) sign followed by the built-in function name. If the built-in function contains parameters, the function name is followed by the parameters enclosed in parentheses. Built-in function parameters are often referred to as arguments. These arguments can be any valid literal, field, expression, or another built-in function. When more than one argument is specified, they are separated by the : (colon) symbol. Spaces are not significant to built-in functions or expressions. All built-in functions have the following syntax:

    %funct( arg1 : arg2 : ... argn ) 

For those built-in functions that do not support parameters, parentheses are not required. For example, %PARMS supports no parameters, so %PARMS or %PARMS() may be used. In earlier releases of RPG, (i.e., OS/400 Version 4 and earlier) empty parentheses were not allowed, so only %PARMS would be valid, and %PARMS() would be invalid. The syntax for built-in functions is the same as the syntax used when calling a subprocedure.




The Modern RPG IV Language
The Modern RPG IV Language
ISBN: 1583470646
EAN: 2147483647
Year: 2003
Pages: 156
Authors: Robert Cozzi

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net