\HCI=12 \FONT=ELITE \H1=TEXT:"EDX INITIALIZATION FILES" \H2=TEXT:"Creating Initialization Files" \index=(TOPIC:"Initialization Files") \HCI=10 \FONT=COURIER \CONTENTS=1 APPENDIX A: EDX INITIALIZATION FILES \index=(TOPIC:"Initialization Files") \contents=2 A.1 OVERVIEW \HCI=12 \FONT=ELITE An initialization file enables you to modify the initial default characteristics of your EDX editing session by automatically executing a series of commands when the editor is first invoked. Initialization files are written in the VAXTPU programming language. However, no prior knowledge of VAXTPU is required to make a simple initialization file. Sections A.2 and A.3 below describe how to create and use EDX initialization files. Section A.4 gives some examples of EDX initialization files. \HCI=10 \FONT=COURIER \contents=2 A.2 SPECIFYING AN INITIALIZATION FILE WHEN INVOKING EDX \HCI=12 \FONT=ELITE After creating your initialization file, define a symbol in your login.com file to invoke the editor using the initialization file. Do this by defining your symbol as 'EDX' plus a /COMMAND=init-file qualifier. For example, if your initialization file were named EDXINI.TPU, you could create the following symbol: $ EDXI :== 'EDX'/COMMAND=disk:[directory]EDXINI.TPU Replace 'disk:[directory]' with the appropriate disk and directory specification for file EDXINI.TPU. Note that the single quotes around 1 This assumes that the system manager has set up the following system wide symbol: EDX :== EDIT/TPU/NOCOMMAND/SECTION=SYS$LIBRARY:EDTSCNSEC Note that even though the symbol EDX contains the qualifier /NOCOMMAND, this qualifier is superseded later on in the line by the /COMMAND=disk:[directory]EDXINI qualifier. 'EDX' are required for proper symbol translation.1 \HCI=10 \FONT=COURIER \contents=2 A.3 CREATING EDX INITIALIZATION FILES \HCI=12 \FONT=ELITE EDX initialization files are fairly easy to write. Below is an example of an EDX initialization file (the function of each statement here will be described later): do_command("SET SEARCH WILD"); !Execute a line mode command define_key("END_OF_WORD",PF2); !Define a key toggle_ruler_line; !Display the ruler line make_two_windows(0,0); !Switch to dual window mode Here are a few simple rules to remember when writing an initialization file: 1. Notice that each statement is terminated with a semicolon (;). If you forget the semicolon your initialization file will generate an error message when you try to use it. 2. Remember to enclose all strings with a matching set of either single or double quotes (" or '). 3. Comments may be inserted into the file by preceding them with an exclamation point (!). 4. You may use upper and/or lowercase letters as you wish. VAXTPU is not case sensitive. 5. You may freely insert spaces between the lexical elements of a statement. For example: do_command ( "SET SEARCH WILD" ) ; \index=(TOPIC:"Line mode commands", "in initialization files") \contents=3 A.3.1 How to Execute Line Mode Commands To execute an EDX line mode command use the following procedure: do_command("line-mode-command"); Below are some examples: do_command("SET WRAP 72"); do_command("SET SEARCH WILD"); do_command("SET CURSOR FREE"); do_command("SET TAB_KEY SPACES"); do_command("SET TAB 5, 15, 36, 50"); do_command("LOCK BUFFER"); \index=(TOPIC:"defining keys", STOPIC:"in initialization files") \contents=3 A.3.2 How to Define Keys To define a key to perform a certain function use the following procedure: define_key('vaxtpu-command', key-name); Here 'vaxtpu-command' is any VAXTPU built-in function listed in the VAX Text Processing Utility Manual or any procedure defined by the EDX editor listed in appendix B. Key-name is the name of the key, control key, or GOLD key sequence you wish to define. A table of all the keys and their associated key names is included in appendix C. Define_key is a VAXTPU built-in function. For further information, see the VAX Text Processing Utility Manual. Below are some examples: (1) define_key( 'do_command("FIND=Z")', key_name("Z",shift_key) ); This example defines the key sequence GOLD Z as execute the EDX line mode command "FIND=Z". That is, GOLD Z causes buffer Z to be placed in the current window and positions the cursor at the last cursor position for that buffer. (2) define_key( 'do_command("DIR/SIZE/DATE")', DO); This example defines the DO key on a VT200 series keyboard as execute the EDX line mode command "DIR/SIZE/DATE". Pressing the DO key will cause EDX to prompt for a directory specification and then display a listing of all the specified files along with their size and date. (3) define_key( 'copy_text("C ")', key_name("A",shift_key) ); This example defines the key sequence GOLD A as copy the string "C " (a capital C followed by 5 spaces) into the current buffer at the cursor position. (copy_text is a VAXTPU built-in). (4) define_key( 'keypad_help', PF2); This example defines the keypad PF2 key to execute the EDX defined procedure 'keypad_help'. Pressing the keypad PF2 key will display on the screen the keypad and keyboard help diagrams. \index=(TOPIC:"Ruler Line', STOPIC:"switch on in initialization file") \contents=3 A.3.3 How to Toggle On/Off the Ruler Line at the Top of the Screen To toggle on the ruler line at the top of the screen include the following command in your initialization file: toggle_ruler_line;  \index=(TOPIC:"window modes", "switch in initialization file") \contents=3 A.3.4 How to Switch From Single Window Mode to Dual Window Mode To switch from single window mode to dual window mode use the command: make_two_windows(second-buffer,file-name);  This command places the current buffer in the top window and the second buffer specified in the bottom window with the cursor. The one exception is if dual windows are already being used and the cursor is currently in the bottom window in which case the current buffer is left in the bottom window and the second buffer specified is placed in the top window with the cursor. PARAMETERS: second-buffer A string containing the name of buffer to put in second window. Enclose the string in quotes ("). If the buffer does not exist, one is created. If a null string "" is specified, a buffer name is prompted for. If the numeric value 0 is specified, there is no prompt and no buffer is mapped to the second window. file-name A string containing a file name. Enclose the string in quotes ("). If the buffer name specified by the second-buffer parameter does not exist, then one is created and the file name specified by this parameter is read into the newly created buffer. If a null string "" is specified, an optional file name is prompted for. If the numeric value 0 is specified, there is no prompt and no file is read into the newly created buffer. Below are some examples: make_two_windows("A",0); ! Make two windows with current ! buffer as first buffer and ! buffer "A" as second buffer. make_two_windows("A","DATA.DAT");! Make two windows with current ! buffer as first buffer and new ! buffer "A" as second buffer. ! Read in file "DATA.DAT" into ! new buffer "A". make_two_windows(0,0); ! Put current buffer in top window. ! Bottom half of screen is left ! for messages. \H2=TEXT:"Example Initialization Files" \HCI=10 \FONT=COURIER \contents=2 A.4 EXAMPLE EDX INITIALIZATION FILES \HCI=12 \FONT=ELITE \contents=3 A.4.1 Example EDX Initialization File for Text Editing (FILE EDXTINI.TPU) do_command("SET WRAP 72"); do_command("SET SEARCH WILD"); define_key( 'do_command("FIND=Z")', key_name("Z",SHIFT_KEY) ); define_key( 'do_command("FIND=A")', key_name("A",SHIFT_KEY) ); define_key( 'keypad_help', key_name(PF2) ); The above example EDX initialization file could be used when you are editing text. To use the above initialization file, place the following line in your LOGIN.COM file (replace 'disk:[directory]' with the 1 The single quotes around 'EDX' are required for proper symbol translation. This assumes that the system manager has set up the following system wide symbol: EDX :== EDIT/TPU/NOCOMMAND/SECTION=SYS$LIBRARY:EDTSCNSEC Note that even though the symbol EDX contains the qualifier /NOCOMMAND, this qualifier is superseded later on in the line by the /COMMAND=disk:[directory]EDXTINI qualifier. appropriate disk and directory specification for file EDXTINI.TPU):1 $ EDXT :== 'EDT'/COMMAND = disk:[directory]EDXTINI.TPU Then invoke the editor with: $ EDXT filename The above initialization file does the following: · The text automatically wraps after 72 characters. · The wildcard characters (%, *, and others) can be used in the search. · "GOLD Z" and "GOLD A" can be used to go to buffers named "Z" and "A". · The keypad key PF2 obtains the keypad and keyboard HELP diagrams. \contents=3 A.4.2 Example Initialization File for Writing FORTRAN Code (FILE EDXCINI.TPU) do_command("SET SCREEN 72"); do_command("SET TAB_KEY SPACES"); do_command("SET TABS 7,9,11,13,15,17,19,21,23"); do_command("SET SEARCH WILD"); do_command("SET SHIFT_AMOUNT 16"); define_key( 'do_command("FIND=Z")', key_name("Z",SHIFT_KEY) ); define_key( 'do_command("FIND=A")', key_name("A",SHIFT_KEY) ); define_key( 'enter_text(" *")', key_name("E",SHIFT_KEY) ); define_key( 'enter_text("C ")', PF2); define_key( 'keypad_help', key_name(PF2,SHIFT_KEY) ); The above example initialization file could be used when you are editing FORTRAN code. To use the above initialization file, place the following line in your LOGIN.COM file (replace 'disk:[directory]' with the 2 The single quotes around 'EDX' are required for proper symbol translation. This assumes that the system manager has set up the following system wide symbol: EDX :== EDIT/TPU/NOCOMMAND/SECTION=SYS$LIBRARY:EDTSCNSEC Note that even though the symbol EDX contains the qualifier /NOCOMMAND, this qualifier is superseded later on in the line by the /COMMAND=disk:[directory]EDXCINI qualifier. appropriate disk and directory specification for file EDXCINI.TPU):2 $ EDXC :== 'EDX'/COMMAND = disk:[directory]EDXCINI.TPU Then invoke the editor with: $ EDXC filename The above initialization file does the following: · The screen will display 72 characters only; the existence of characters beyond column 72 is denoted by the usual diamond. · The tab key will provide 6 blanks, so is useful for beginning FORTRAN code lines. Additional pressing of the tab key will provide two more blanks, useful for indenting structured code in FORTRAN or SIMULTRAN. · The wildcard characters (%, *, and others) can be used in the search. · "GOLD left arrow" and "GOLD right arrow" will each produce a shift of 16 characters. · "GOLD Z" and "GOLD A" can be used to go to buffers named "Z" and "A". · The keypad key PF2 produces a "C" followed by five blanks, useful for beginning comment lines. · "GOLD E" produces five blanks followed by a "*", useful for beginning continuation lines. · "GOLD PF2" obtains the keypad and keyboard help diagrams.