call

Execute the specified entry or global ProcScript.

call  {Library::}LitEntryName { ( ArgumentList ) }

Example: call myEntry

Parameters

Parameters
Parameter Data Type Description
Library Literal Library containing the global ProcScript module. If not specified, the default library is used.
LitEntryName Literal Literal name of a module declared on an entry statement; do not enclose LitEntryName in double quotation marks (").
ArgumentList String Comma-separated list of arguments to the module. The number of arguments supplied must match the number and type of parameters defined with the params statement for the LitEntryName. If the data type of an argument does not match the type of the corresponding parameter, Uniface attempts to convert the data to the proper type.

The ArgumentList is of the form:

Argument 1 ,Argument 2 , ... ,Argument n

Return Values

Values returned in $status
Value Description
-1 An error occurred. $procerror contains the exact error.

Values of parameters with direction OUT and INOUT must be considered to be undefined in the component that called LitEntryName.

0 $status has not been assigned a value, no value is returned by the called module, or there is no return statement present.
>0 Value returned by the entry that was called. (Uniface expects -1 to be an error, so it is not a good idea to return that value from the called ProcScript entry.)

Note:  The value in $status can affect the way the structure editor behaves when it is activating a sequence of triggers. If you call an entry in a trigger, make sure that the value returned by the entry does not adversely affect the structure editor.

Values Returned in $procerror Following call
Value Symbolic error Meaning
-1109 <UPROCERR_ENTRY> The entry name specified cannot be found.
-1113 <UPROCERR_PARAMETER> Parameter name not valid or not defined.
-1122 <UPROCERR_NARGUMENTS> Wrong number of arguments.

Use

Allowed in all component types. However, calling a global ProcScript is not allowed in self-contained services and reports.

Description

In specifying the argument list:

  • When the entry expects a basic parameter (that is, a field, component variable, or a named parameter) with direction IN, the corresponding argument in ArgumentList can be a constant, a field, an indirect reference to a field, a variable, or a function. The argument's value is placed in the module's parameter at the start of the entry.
  • When the entry expects a basic parameter with direction INOUT, the corresponding argument in ArgumentList can be a field, an indirect reference to a field, a variable, or a function to which a value can be assigned. The argument's value is placed in the module's parameter at the start of the entry; the value in the entry at its end is returned to the field, variable, or function.
  • When the entry expects a basic parameter with direction OUT, the corresponding argument in ArgumentList can be a field, an indirect reference to a field a variable, or a function to which a value can be assigned. The value in the entry at its end is returned to the field, variable, or function.

Locating the Called Module

When resolving a call statement, Uniface looks for a local entry in the triggers of the component.

When resolving a call to a global ProcScript, and no library is specified by the call statement, Uniface looks for it in the following order:

  1. If no library is specified, in the component library
  2. In the library specified in the application shell properties
  3. In the library SYSTEM_LIBRARY

If a library is specified by the call statement and Uniface cannot find it in that location, it looks no further and returns an error.

For more information, see Compilation Process.

Using call

The following example shows how to use the call statement:

entry LSTORE
  store
  if ($status < 0)
      message "Store error!"
      rollback
else
      message "Store done."
      commit
endif
end ;  LSTORE
trigger store
  call LSTORE
  return ($status)
end; store
trigger accept
  if ($formdbmod = 1)
    call LSTORE
  endif
  return ($status)
end; accept
History
Version Change
9.5.01 Introduced the use of a double-colon (::) rather than a single colon (:) when specifying a library. The use of a single colon is no longer supported.

Related Topics