mumps.mumps_function_ex()/mumps.mumps_procedure_ex()
Calls a MUMPS extrinsic function or routine or subroutine, supporting argument passing where arguments are MUMPS local or global variables, either by value or by reference.
Arguments
Argument | Data Type | Required | Description |
---|---|---|---|
fn | string | Yes | The function/routine/subroutine to be called |
args | array | Yes | An array of arguments to be passed to fn |
autoRelink (CFMumps 0.05 and later only) | boolean | No | If true, the routine called through this API will be automatically re-linked before being executed. This allows you to use the most recent version of a routine without re-starting the CF application server. Omitting this parameter is equivalent to supplying it with a value of false. |
Variable Arguments (By Value or By Reference)
If you wish to pass a MUMPS variable (local or global) as an argument, you must pass that element of the arguments array as a struct containing  type and data members.
The type member must be either byval or byref. If it is byval, this is equivalent to passing a bare variable in MUMPS code, like this:
S X=$$FN^RTN(MYVAR)
If it is byref, this is equivalent of preceding the variable name with a dot, like this:
S X=$$FN^RTN(.MYVAR)
Return Value
Returns a value of type struct, representing the current state of the MUMPS symbol table, as well as the return value of the function (or 1 if calling mumps_procedure_ex()). The struct members are result, containing the argument used in the called extrinsic function's final QUIT command, in the case of mumps_function_ex(), or 1 in the case of mumps_procedure_ex(), and locals, containing all of the contents of the MUMPS local symbol table as it existed after the extrinsic function/routine/subroutine was called.
Example
This example returns data from the VistA NEW PERSON file (in result.newPerson).
var mumps = new lib.cfmumps.Mumps(); mumps.open(); var result = mumps.mumps_procedure_ex("GETS^DIQ", [200, "1,", "**", "", "newPerson"]); writeDump(result.newPerson); mumps.close();
<cfset mumps = new lib.cfmumps.Mumps()> <cfset mumps.open()> <cfset result = mumps.mumps_procedure_ex("GETS^DIQ", [200, "1,", "**", "", "newPerson"])> <cfdump var="#result.newPerson#"> <cfset mumps.close()>