 |
» |
|
 |
|
 |

Copyright (c) Digital Equipment Corporation 1988. All rights reserved
LAYERED PRODUCT: VAX PL1 OP/SYS: VMS
SOURCE: Digital Customer Support Center
OVERVIEW:
This program demonstrates how to call some of the Librarian Utility
Routines.
CAUTION: This sample program has been tested using VAX PL1 V3.1 on VMS
V5.0. However, we cannot guarantee its effectiveness because of the
possibility of errors in transmitting or implementing it. It is meant
to be used as a template for writing your own program, and it may
require modification for use on your system.
PROGRAM NOTES:
The program first calls LBR$INI_CONTROL. This routine must always be
called before any other librarian routine, with the exception of
LIB$OUTPUT_HELP. The second call is to LBR$OPEN. In this instance the
library being opened is SYS$LIBRARY:PLI$STARLET.TLB. The third call is
to LBR$LOOKUP_KEY. The purpose of this call is to determine if the
module SYS$SETIMR was in SYS$LIBRARY:PLI$STARLET.TLB. LBR$CLOSE is
called to close the library.
PROGRAM SAMPLE:
PLILBR: proc options(main);
%include lbr$ini_control;
%include lbr$open;
%include lbr$lookup_key;
%include lbr$close;
%include $ssdef;
%include $stsdef;
%include $lbrdef;
dcl lib_idx_ptr fixed bin(31);
dcl lib_name char(27) init('SYS$LIBRARY:PLI$STARLET.TLB');
dcl mod_name char(10) init('SYS$SETIMR');
dcl func fixed bin(31) init(lbr$c_read);
dcl rfa(2) fixed bin(31);
sts$value = LBR$INI_CONTROL(lib_idx_ptr,func,,);
if ^sts$success
then signal vaxcondition(sts$value);
sts$value = LBR$OPEN(lib_idx_ptr,lib_name,,,,,);
if ^sts$success
then signal vaxcondition(sts$value);
sts$value = LBR$LOOKUP_KEY(lib_idx_ptr,desc(mod_name),ref(rfa));
if ^sts$success
then signal vaxcondition(sts$value);
sts$value = LBR$CLOSE(lib_idx_ptr);
if ^sts$success
then signal vaxcondition(sts$value);
put skip file(sysprint) list ('Module was found in library');
put skip file(sysprint) list ('***PROCESSING COMPLETE***');
end PLILBR;
|
buy online or call 1.800.AT.COMPAQ
|
|