RCB_SETARGS

Set multiple arguments in a single call

WSupported on Windows
USupported on Unix
VSupported on OpenVMS

 

xcall RCB_SETARGS(rcbid, startargnum, arglist)

Arguments

rcbid

The ID of a routine call block previously created with %RCB_CREATE. (n)

startargnum

The one-based starting position for setting arguments. (n)

arglist

The argument list. At least one argument must be set. (a or n)

Discussion

The RCB_SETARGS subroutine can only be used when data is passed by descriptor. (In other words, it cannot be used for ^REF and ^VAL arguments.)

If startargnum is less than or equal to 0 or greater than the number of arguments specified in %RCB_CREATE, an error is signaled.

You can include as many arguments in arglist as you want, as long as the total number set in the routine call block does not exceed the number specified in %RCB_CREATE.

Examples

record
    rcbid       ,i4
    arg_1       ,a3
    arg_2       ,d3
    arg_3       ,d6.3
    arg_4       ,a4
    arg_5       ,i4
proc
    rcbid = %rcb_create(5)              ;Create an RCB block with 5 args
    xcall rcb_setargs(rcbid, 1, arg_1, arg_2, arg_3, arg_4, arg_5)
    xcall rcb_setfnc(rcbid, "routine")  ;Set function to be called
    xcall rcb_call(rcbid)               ;Call function as xcall routine(arg_1,
                                        ; arg_2, arg_3, arg_4, arg_5)
    xcall rcb_delete(rcbid)             ;Delete RCB block
end

Also see %RCB_CALL Examples.