Editing the configuration file

%externalroutine modftrans ( %string(31) FILE ) To use modftrans, type modftrans <filename> ,where <filename> is the name of a new file, or a configuration file previously created with this program. If a file that was not created with this program is supplied, the program will terminate saying so. You will be told if the file is a new file ( <filename> is a new file ); if it isn't, ignore the message CONFIG#WORK is a copy of <filename> This is output by the routine that copies the original file to a workfile CONFIG#WORK. The program then prints out the first descriptor in the file ( see the description of the command P for Print ), and gives the prompt Config : to which you reply with a command.

Commands


Help

? ( for help ) -------------- Type ? for help information. This gives a list of the commands available, along with a ( very ) brief description of what they do. It also gives the legal commands when inserting a descriptor ( more about this under the commands I and C ).

Defaults

! ( to print out the defaults for a descriptor ) ------------------------------------------------ The command ! prints out a list of the default settings for a descriptor. The command takes no parameters.

Move

M ( for Move ) -------------- M moves to the next descriptor. Note that you can only move, insert, delete etc in whole descriptors, not parameter by parameter. If M is not followed by any parameters, the movement is forward by 1 descriptor. However it is possible to suffix the command by an integer ( non-zero, but negative numbers are allowed; they move backwards ). Instead of using a number, you can suffix the command with * ( or -* ), meaning a very large number - to the end ( or beginning ) of the file. If the move would take you off either end of the file, you stop at the end. This command causes the position in the file to be printed out after the command line has been executed.

Print

P ( for Print ) --------------- P prints out descriptors in the file. The same notes and comments apply as for M: you can print out n, -n, '*' or '-*' descriptors, and you can't print out off either end of the file. Also, the program tells you if you are at the beginning or the end of the file, with the message ** First station ** or ** Last station ** Note that to get the latter message, you must be AFTER the last descriptor, which will be a blank descriptor ( no parameters ).

Insert

I ( for Insert ) ---------------- I allows you to insert descriptors into the file. You follow the command with with the number of descriptors you want to insert ( not zero or negative, 1 by default ). You can't have more than 512 stations, so if you try to insert a number that would give a total of more than this, the number is trimmed, and you are told how many may be input. For each parameter of a descriptor, you are told the default, if one exists. You are then prompted for the value or setting of the parameter. Legal replies are : <return> means leave as defaulted ( if there is no default, the program asks for another reply ) * means leave this and all the other parameters as defaulted ( if either this parameter or any following ones have no default, the program asks for another reply ); ? means 'help' - the program supplies a brief description of the parameter, and perhaps possible settings; <text> means set the parameter to <text>.
If either the descriptor is longer than 4096 bytes, or the total file length with the new descriptor is longer than 200 Kbytes, the insertion is aborted with the message Descriptor too large

Delete

D ( for Delete ) ---------------- You can delete descriptors from the file with the command D. Legal parameters are n or * ( or 1 by default ); you can't delete backwards. The best way to delete -n descriptors is to set up the macro 'M-D' ( see under command U ) and then give the command Xn ( Execute macro n times ); DON'T use M-nDn, since if you hit the top of the section prematurely, you will still delete n descriptors, which will be more than intended. This command causes the position in the file to be printed out when the command line has been executed.

Change

C ( for Change ) ---------------- Using the command C allows you to edit ( change ) a descriptor parameter by parameter, instead of having to use DI. The parameters are the same as for D : n or *, or 1 by default. This is the only command that doesn't strictly work in whole descriptors, but in parameters. For each parameter, the program displays the current setting, then prompts you with the name of the parameter. The legal replies are : <return>, meaning 'leave this parameter as it is', <*>, meaning 'leave the rest of the descriptor as it is', and <text>, meaning 'set this parameter to <text>'. Again, like I, if either the descriptor is longer than 4 Kbytes, or the total file length longer than 200 Kbytes, the change is aborted with the message Descriptor too large. To simulate the command C-n, set up the macro M-CM- ( move backwards 2 since the command C moves you onto the next descriptor after changing one ), then give the command Xn. This command is one that causes the position in the file to be printed out when the command line has been executed.

Find

F ( for Find ) ______________ F allows you to move to the first descriptor ( in either direction ) that contains a certain string. The legal formats of the command are : F/text/ means search for the first occurrence of the string 'text' in the file and stops at the beginning of the descriptor containing it ( remember the program only works in whole descriptors ), F-/text/ searches backwards for the last occurrence of 'text' in the same manner, F and F- search forwards and backwards respectively for the last used text ( which must have been defined ), F? prints out the current search text, or 'Not defined' if not defined. In any format, if the text is not found, the message String not found is output and the position in the file is not changed.
The search is carried out case-independantly. To include the character / in the search string, it needs to be included twice : F/ABC//DEF/ searches for the string 'ABC/DEF'. F is another command that prints out the position in the file after the command line has been executed.

Change Top

T ( to change Top of file ) --------------------------- The first four lines of the file contain parameters for MAILER. These are IPL discs, Update, This host and Dead Letters. The command T changes these, exactly like changing a descriptor - replies are *, null or <text>.

Repeat

R ( to repeat a descriptor ) ---------------------------- The command R must be followed by the name of a station, in delimiters. The program takes a copy of the station with the given name, placing it in front of the current descriptor.

List

L ( to list file to a character file to be sent to a printer, for example ) ---------------------------------------------------------------------------- The command L lists the defaults, followed by the file itself, to a character file. The name of this file can be specified after the command, inside delimiters ( "/"'s ). If none is specified, the default name is used instead. This is the name of the input file, followed by an "L". If the list file already exists, you are asked whether it is ok to overwrite it. If it is not ok, the program returns to editing without doing anything.

Compile

K ( to Kompile the file ) ------------------------- The parameter for the command K is similar to that for L(ist). If it is followed by a file name in delimiters, that name is used. Otherwise the default name ( the input file name suffixed with "Y" ) is used. If a name is specified, the default file name is set to it too, so if the compilation fails, the name need only be given once. If the output file so found already exists, you are asked whether it is ok to overwrite it. If it is, the program tries to compile the configuration file. If it fails, it returns to the editor. If it succeeds, the program terminates.

Set up macro

U ( to set up User-defined macro ) ----------------------------------- U allows you to set up a macro, which can be repeatedly executed. For example, the macro F/XYZ/PM, followed by the command X10 ( execute macro 10 times ), will find and print out the next 10 descriptors containing 'XYZ'. To set the macro, reply to the prompt Macro defn: with the command(s) you want, just as you would to the prompt Config : If the command following U is ?, or the reply to the prompt Macro defn: is ?, the current macro is displayed instead. The macro can't contain the commands U, X, A(bort), E(nd) or K(ompile)

Execute macro

X ( for Execute macro ) ----------------------- The command X executes the current user-defined macro a certain number of times - the number following the command ( not zero or negative ), 1 by default. The macro cannot contain the commands U, X, A(bort) or E(nd); trying to use any of these results in the messages Can't use U ( or whatever ) in a macro and Illegal macro, the execution of the command line is stopped and the macro is deleted. The same happens if the macro contains an illegal command ( eg Z, or P0 ), except that the error messages are Illegal command or Illegal parameter for PRINT ( or whatever ) followed by Illegal macro respectively. If a command like F/ABCD/ fails, the execution of the macro and the command line ceases, but the macro isn't destroyed.

Abort

A ( for Abort ) --------------- The command A aborts the editing session, without changing the input file, if, for example, you delete all the stations by mistake. The program gives you the prompt Abort : to which you reply A ( abort ) or Y ( yes ) to abort the editing, and anything else to return to the program without losing anything.

End

E ( for End ) ------------- The command E ends the editing session, saving all the changes made in the input file.

Name formats

The NRS requires that hosts can each be called by several names. The system used in this program for this is as follows. a character is either a letter, a digit or a dash "-" a word is one or more characters an item is a word or null "" a list of alternatives is a left bracket "(", followed by one or more items separated by commas, followed by a right bracket ")" a piece is either a word or a list of alternatives a component is one or pieces separated by dots a name is then one or more components separated by commas eg "uk.ac.(edinburgh,ed,rco),edinburgh,ed,rco" is legal. The host so named can then be accessed by any of the alternatives. In the above example, for instance, there are 6 choices : uk.ac.edinburgh, uk.ac.ed, uk.ac.rco, edinburgh, ed and rco, with the first of these being the preferred name.
If any of these 6 alternatives is then included as the first part of another name, all are considered included. For instance, if the above example were followed by a host with the name uk.ac.edinburgh.(emas,2972), this host could be accessed by 12 different names - any of the above 6 followed by ".emas", or any followed by ".2972". Again, it is the first choice that is the preferred name : uk.ac.edinburgh { the preferred name for the first} example } .emas If an entry is just for a directory rather than a host ( eg uk.ac.edinburgh rather than uk.ac.edinburgh.emas ) reply BASE to parameter Address type. This implies that all parameters except Name and Description are irrelevant, so you won't get prompted for them.