Command Files A command file contains TPU procedures and statements to customize or extend EVE, or to create a special environment for building your own TPU application. Default file type is .TPU. Example: The following is a sample command file containing a procedure to swap or transpose characters, and a key definition for that procedure: +---------------------------------------------------------------+ | PROCEDURE user_swap_char | | LOCAL swap_this; | | swap_this := ERASE_CHARACTER (1); ! Erase current character | | MOVE_HORIZONTAL (-1); ! Move back one character | | EVE$INSERT_TEXT (swap_this); ! Insert erased character | | RETURN (true); | | ENDPROCEDURE; | | | | EVE$DEFINE_KEY ("user_swap_char", KEY_NAME ("s", SHIFT_KEY), | | "swap char", EVE$X_USER_KEYS); | +---------------------------------------------------------------+ Usage notes: o There are three ways to specify the command file you want to use: * Invoke EVE using the /COMMAND= qualifier and specifying the command file. * Create a TPU$COMMAND.TPU file in your current, default directory (you need not use the /COMMAND qualifier). * Define the TPU$COMMAND logical name to specify the command file. You need not use the /COMMAND qualifier, and you can keep the file in any convenient directory or subdirectory. For more information, see DCL help on EDIT/TPU/COMMAND or see the EVE Reference Manual. o At startup, TPU compiles the procedures in the command file and executes any statements at the end of the command file, such as DEFINE_KEY statements. Procedures, settings, and key definitions in the command file override those in the section file. o To compile and execute a command file during a session, use commands such as the following to edit the command file, compile the procedures it contains, and execute a compiled procedure: Command: GET FILE procs.tpu Command: TPU EXECUTE (CURRENT_BUFFER) Command: TPU user_proc o When you use SAVE ATTRIBUTES or when you save attributes as part of exiting or quitting, you can have EVE create or update a command file to save most global settings and any menu definitions. EVE generates a specially marked block of TPU statements like the following: +----------------------------------------+ | ! EVE-generated code begin | | ! EVE attributes begin | | eve$set_find_case_sensitivity (FALSE); | | eve_set_box_noselect; | | eve_set_box_pad; | | eve_set_cursor_bound; | | eve_set_nodefault_command_file; | | eve_set_nodefault_section_file; | | eve_set_exit_attribute_check; | | eve_set_pending_delete; | | eve_set_section_file_prompting; | | eve_set_tabs ('INSERT'); | | eve_set_tabs ('VISIBLE'); | | ! EVE attributes end | | ! EVE-generated code end | +----------------------------------------+ o If you prefer to save in a command file, use the following commands, so that SAVE ATTRIBUTES prompts for a command file---without first prompting for a section file---and shows the name of your default command file (TPU$COMMAND.TPU) in the prompt line: Command: SET NOSECTION FILE PROMPTING Command: SET NODEFAULT SECTION FILE Command: SET DEFAULT COMMAND FILE tpu$command.tpu Command: SAVE ATTRIBUTES o If you want all your buffers to have the same margins or tab stops, you can execute a TPU$LOCAL_INIT procedure in your command file, instead of using an EVE initialization file---for example: +------------------------------------------+ | PROCEDURE tpu$local_init | | eve_set_left_margin (4); | | eve_set_right_margin (72); | | eve_set_tabs ("EVERY 10"); | | ENDPROCEDURE; ! my defaults | | . | | . | | TPU$LOCAL_INIT; ! execute init procedure | +------------------------------------------+ When you invoke EVE using that command file, the settings in your TPU$LOCAL_INIT procedure apply to the MAIN buffer (or buffers initially created from your input files) and to the $DEFAULTS$ buffer, so that each buffer you create has the same settings. For more information, see help on Defaults. o The EVE source files are available online as examples of TPU programming and as a library of TPU procedures. For a list of the EVE source files, use the following DCL command: $ DIRECTORY SYS$EXAMPLES:EVE$*.TPU Related topics: Attributes Initialization Files Section Files SAVE ATTRIBUTES SET DEFAULT COMMAND FILE TPU