DTRHELP.HLB  —  Commands Statements Clauses, DEFINE PROCEDURE Command, Examples
       The following example shows how to define a procedure to set
       your default directory to the DEMO directory, which contains the
       sample data for the YACHTS, OWNERS, and FAMILIES domains:

       DTR> DEFINE PROCEDURE DEMO
       DFN> SET DICTIONARY CDD$TOP.DTR$LIB.DEMO
       DFN>     SHOW DICTIONARY
       DFN> END_PROCEDURE
       DTR> :DEMO
       The default directory is CDD$TOP.DTR$LIB.DEMO
       DTR>

       The following example shows how to define a procedure that
       displays a group of boats with a price less than a figure you
       supply when the procedure runs:

       DTR> DEFINE PROCEDURE PRICE_LIST
       DFN>     READY YACHTS
       DFN>     PRINT SKIP, COL 20,
       DFN>           '*** Price List of YACHTS ***', SKIP
       DFN>     FOR YACHTS WITH PRICE NE 0 AND
       DFN>         PRICE LE *.'the ceiling price'
       DFN>           PRINT BOAT
       DFN>     PRINT SKIP, COL 10, 'See anything interesting?'
       DFN> END_PROCEDURE
       DTR> :PRICE_LIST

                          *** Price List of YACHTS ***

       Enter the ceiling price: 5,000

                                      LENGTH
                                       OVER
       MANUFACTURER   MODEL     RIG    ALL   DISPLACEMENT BEAM  PRICE

        CAPE DORY   TYPHOON    SLOOP   19        1,900     06   $4,295
        VENTURE     21         SLOOP   21        1,500     07   $2,823
        VENTURE     222        SLOOP   22        2,000     07   $3,564
        WINDPOWER   IMPULSE    SLOOP   16          650     07   $3,500

                See anything interesting?

       DTR>

       The following example shows how to use a OpenVMS command line to
       invoke the procedure created in the first example:

       $ DTR32 EXECUTE DEMO
       The default directory is CDD$TOP.DTR$LIB.DEMO

       $
Close Help