callproc, callproclsa
Purpose
Synopsis
function callproc(proc:string|any):reflecterror
function callproc(proc:string|any, p1, p2...):reflecterror
function callproclsa(proc:string|any, lsa:list):reflecterror
Arguments
|
proc
|
The name or a reference to the procedure to call
|
|
pi
|
Parameters of the procedure
|
|
lsa
|
List of parameters of the procedure
|
Return value
The error status as a
reflecterror
Example
The following Mosel code:
public procedure myproc(i:integer)
writeln('hello world ',i);
end-procedure
callproc('myproc',333)
produces this output:
hello world 333
Further information
1. When used with a name this routine selects the procedure to call based on the provided arguments without performing any conversion (for instance, using an integer where a real is expected will not work). The execution will terminate on a runtime error if no compatible procedure can be found.
2. The last version of the subroutine makes it possible to pass all the subroutine parameters via a single list.
3. The execution status of the function is notified via its return value. If this value is ignored (
i.e. the function is used as a procedure) the execution of the model will be interrupted in case of error (
e.g. routine not found or invalid number or type of parameters).
Related topics
Module
© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation ("FICO"). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.
