Execute a routine in a shared image




VSupported on OpenVMS
value = %DBL$EXECUTE_IMAGE_ROUTINE(file, routine, ^VAL(nargs)[, arguments, …])


xcall DBL$EXECUTE_IMAGE_ROUTINE(file, routine, ^VAL(nargs)[, arguments, …])

Return value


The return value for routine. (n)



The name of the shared image file. The default file specification SYS$SHARE:.EXE is used. (a)


The name of the routine to be executed. (a)


The number of arguments to be passed to routine. If there are no arguments, nargs must
be 0. (n)


(optional) A list of arguments to be passed to routine.


The DBL$EXECUTE_IMAGE_ROUTINE subroutine executes a routine contained in a shared image. The shared image does not have to be linked with the user program.

Only the filename component of file is significant. The device, directory, and file type field are ignored. By default, OpenVMS attempts to locate the file in SYS$SHARE: unless the name is a logical. The only way to use a shared image file that is not in SYS$SHARE is by assigning a logical to refer to it, and passing that logical name as file.

DBL$EXECUTE_IMAGE_ROUTINE uses LIB$FIND_IMAGE_SYMBOL to find the address of the routine specified by routine. All restrictions and rules that apply to LIB$FIND_IMAGE_SYMBOL also apply to DBL$EXECUTE_IMAGE_ROUTINE.

Arguments must follow the same rules as if routine was being called using the XCALL statement.

LIB$FIND_IMAGE_SYMBOL signals all errors if unsuccessful.

See also



If subroutine SUB is in the shared image MY_SHR_LIB and is normally called as

xcall sub(a, b, c)

then using DBL$EXECUTE_IMAGE_ROUTINE, you would call it as follows:

xcall dbl$execute_image_routine("MY_SHR_LIB", "SUB", ^val(3), a, b, c)