ATG_EDT, Utilities, Nick de Smith's extension to EDT Nick de Smith Applied Telematics Group 7 Vale Avenue Tunbridge Wells Kent TN1 1DJ England +44 892 511000 PSI%234213300154::NICK Extended, Callable EDT ---------------------- Use BUILD.COM to build the ATG_EDT image. Define a foreign command, to access this image. eg. $ edt == "dev:[dir]atg_edt" Then use the symbol EDT as you would normal EDT, with all the qualifiers. I suggest you put ATG_EDT in a directory referenced by the logical ATG$EDT. You can then put the language template files in the same directory (see below). EDTINI.EDT The "standard" EDT initialiser as published ad nausiam. Includes support for ATG_EDT (see below). EDTVT100.DOC A printable, stick-on, explanation of the facilities in EDTINI.EDT. BUILD.COM Command file to build ATG_EDT. ATG_EDT.C, CLIMSGDEF.H This module is a top level interface to callable EDT. It offers many extra features... /OUTPUT /COMMAND /JOURNAL /READ_ONLY /RECOVER /CREATE are the same as on EDIT/EDT If /REMEMBER is used on the command line (the default), then ATG_EDT defines the following logical names: EDT$$GT_CURRENT_FILE current output file name. This can be accessed in any spawned sub-process, or outside of ATG_EDT. If ATG_EDT is invoked without an input filename, the translation of EDT$$GT_CURRENT_FILE is used (if any), ie. the last file edited is the default file to edit. If there was no last file then you will be prompted for the file to edit. EDT$$GT_LANGUAGE_TEMPLATE language template file in the form: ATG$EDT:language.EDT Language File-type ADA ADA BASIC BAS, SUB, INC BLISS BLI, B32, REQ C C, H COBOL COB DCL COM FORTRAN FOR, FTN, F77 MACRO MAR PASCAL PAS RUNOFF RNT, RNO, RNH The language of an input file is determined by its file type. The table "r_template" contains a list of file types and the associated language. If the file type is not recognised, the language is set to "UNKNOWN". In your EDTINI.EDT file, add a line of the form: set command edt$$gt_language_template This will execute the language initialiser for the file you are editing. If the initialiser does not exist, then no error is generated. The XLATE callback supplied in this module supports two modes of operation: 1) Called with a zero length parameter Spawn a sub-process. Suspend EDT session until sub-process terminates. 2) Called with a non zero length parameter Execute the single command passed in a sub-process. Defines 0EDTIN.TMP as the sub-process SYS$INPUT, and 0EDTOUT.TMP as the sub-process SYS$OUTPUT. These files can therefore be written and read by EDT commands. Examples: (replace by an escape character, and by a control-Z character. Each "define key" command should be on a single line. "^Z" is exactly that! An up-arrow followed by a Z). insert =clear_screen [H[J ^Z define key gold $ as "ext write sys$output: =clear_screen ; change ; xlate ref." define key gold ^ as "ext clear edtfilter ; write sys$scratch:0edtin.tmp =edtfilter ; change ; xlate?'DCL Command: ' ext inc sys$scratch:0edtout.tmp ." define key gold * as "cutsr=edtfilter ext find =edtfilter ; change ; er d-c ext find last ; write SYS$SCRATCH:0EDTIN.TMP =edtfilter ; change ; xlate?'DCL Filter: ' ext include SYS$SCRATCH:0EDTOUT.TMP ." These lines define: GOLD $ Spawn a sub-process GOLD ^ Execute a DCL command and include the output at the current position. GOLD * Run a program that reads SYS$INPUT and writes SYS$OUTPUT to process the select region. The current select region contents are written to a file that appears as SYS$INPUT to the program running in the sub-processes. The select region is replaced with SYS$OUTPUT from the sub-process.