PreviousNextIndex

{ } Argument reference

References the value of an argument that a procedure passes to a called external procedure file or to an include file.

ABL converts each argument to a character format. This conversion removes the surrounding double-quotes if the parameter was specified as a character string constant in the RUN statement or include file reference.

When one procedure is called from another and arguments are used, ABL recompiles the called procedure, substituting the arguments that the calling procedure passes, and then runs the called procedure.

Syntax

{ { n | &argument-name } } 

Enter the braces ({}) as shown; they do not represent syntax notation in this description.

n
&argument-name
Examples

The procedure r-arg.p runs procedure r-arg2.p, passing the arguments customer and name to r-arg2.p. ABL substitutes these arguments for {1} and {2} in the r-arg2.p procedure.

r-arg.p
RUN r-arg2.p "customer" "name" 

r-arg2.p
FOR EACH {1}: 
  DISPLAY {2}. 
END. 

The r-inc.p procedure defines the variables txt and num, and assigns the values "Progress VERSION" and "7" to them. The r-inc.p procedure includes the r-inc.ifile and passes the &int and &str arguments to the include file. Because the parameters are named, their order is unimportant. The called procedure can find each argument, regardless of placement. The r-inc.i include file displays a message that consists of the passed arguments. The asterisk argument displays all the parameters as they are listed in the r-inc.p procedure.

r-inc.p
DEFINE VARIABLE cTxt AS CHARACTER NO-UNDO. 
DEFINE VARIABLE iNum AS INTEGER   NO-UNDO. 
ASSIGN 
  cTxt = "Progress VERSION" 
  iNum = 7. 
{r-inc.i &int=iNum &str=cTxt} 

r-inc.i
MESSAGE {&str}     /* the &str named argument */ 
        {&int}.    /* the &int named argument */ 
MESSAGE "An asterisk displays all the arguments:" 
        {*}        /* all the arguments passed by the calling procedure */ 

Notes
See also

; Special character, { } Include file reference, { } Preprocessor name reference, COMPILE statement, DEFINE PARAMETER statement, RUN statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex