The !VOCREC() subroutine reads a VOC record, following links to remote records.
CALL !VOCREC(rec, id)
DEFFUN VOCREC(id) CALLING "!VOCREC"
rec = VOCREC(id)
The !VOCREC() subroutine attempts to read record id from the VOC file. If not found, it tries again using an uppercase version of id.
If the record read from the VOC is an R-type item, the subroutine follows the link, again translating to uppercase if the record is not found exactly as specified in the R-type link.
If the original VOC record or the target of the R-type link is not found, the rec variable is set to a null string, otherwise rec contains the retrieved data.
The STATUS() function returns zero if a record was found or an error code if not.
CALL !VOCREC(STYLE.REC, STYLE.NAME)
IF STATUS() THEN STOP 'Style record not found'
The above program fragment reads the VOC record identified by STYLE.NAME, following any remote link. If no record can be found, the program terminates with an error message.