!FINDPROG()

!FINDPROG()

Top  Previous  Next

 

The !FINDPROG() subroutine searches the catalogue for a named program, returning information about it.

 

 

Format

 

CALL !FINDPROG(result, name)

 

where

 

resultis the returned data.

 

nameis the case insensitive name of the program to find.

 

 

The !FINDPROG() subroutine examines the three catalogue areas in the same order as used when searching for a program within an application (local, private, global). For each instance of the program that is found, information about that program is returned in dynamic array result. This dynamic array has five multivalued fields with a value for each program found:

1Catalogue mode: L (local), P (private), G (global).
2Source pathname, if available.
3Compile time as an epoch value.
4Comments (from $* and $COPYRIGHT), possibly multi-subvalued.
5The full pathname of the object code.

 

Applications using this subroutine should allow for further fields to be added to the returned data in future releases.

 

If the program is not found, result will be returned as a null string.

 

 

Example

 

CALL !FINDPROG(RESULT, 'INVOICE')

NUM.INSTANCES = DCOUNT(RESULT<1>, @VM)

FOR I = 1 TO NUM.INSTANCES

  DISPLAY RESULT<1,I> : '  ' : RESULT<2,I>

NEXT I

 
This program fragment searches for a catalogued program named INVOICE and, for each instance found, displays the catalogue mode and the source pathname.

 

 

See also:

FIND.PROGRAM, CATALOGUED()