HLPWWW (Version 8.7d) JESS copyright (C) 1985-2018
Licensee : Webmaster, Murdoch University, Australia
Welcome. Tuesday, 19-Mar-19 13:48
 
Most JESS programs are 'interactive'. This means that you communicate
with the program while it is executing. You provide information when
prompted by the program and, often, give it commands to perform
various tasks.
 
 
Running JESS Programs
 
How you execute JESS programs necessarily depends on the computer.
Nevertheless, we have tried to develop JESS so that it has the
same appearance and feel on all the hardware and under all the
computer operating systems that support JESS.
 
To start a JESS program running you usually enter "XQT program_name"
(without quotes), where "program_name" could be VEWJTH for example.
Procedures involving sequential program executions and/or
operating system functions (like copying files) are executed
interactively by entering "DOI procedure_name" and in batch (or
background mode), if applicable, by "DOB procedure_name".
 
Consult the index by entering "XQT" or "DOI" (without quotes) for
further information about these facilities.
 
N.B. As a general rule DO NOT terminate any JESS program prematurely
using some non-JESS (system) command (like CTRL/C under the DOS
operating system). Always use JESS commands (like Quit) as described
elsewhere - consult the index by entering "quit" (without quotes).
 
This is particularly important for programs that operate on JESS
databases, like JTH and JLR, and when using the TEL*** programs
of the GEM stage calculations. Lengthy and tedious procedures
are required to recover when a database is not properly closed
because of premature program termination. Consult the index by
entering "premature" for more details.
 
 

You terminate JESS programs by typing Q (for QUIT) at the highest-level prompt in the program. This is a general procedure which operates throughout JESS. If you are positioned at a lower-level prompt you must return to the highest-level. This is done by first escaping from the current prompt, usually by typing Q (for QUIT) or E (for END). The QUIT command operates in the vast majority of cases. The END command is used to terminate a sequence in which data is being directly input. It follows that you can terminate most JESS programs by entering two or three successive QUIT commands. Sometimes QUIT must be preceded by typing E (for END) or by pressing ENTER (to terminate on-the-line editing). You then enter one or two QUIT commands, as required. The program will then terminate (usually after confirming that this is indeed what you want). When the program terminates, you should obtain the symbol or character string used as a prompt by the operating system. N.B. As a general rule DO NOT terminate any JESS program prematurely using some non-JESS (system) command (like CTRL/C under the DOS operating system). Always use JESS commands (like Quit) as described elsewhere - consult the index by entering "quit" (without quotes). This is particularly important for programs that operate on JESS databases, like JTH and JLR, and when using the TEL*** programs of the GEM stage calculations. Lengthy and tedious procedures are required to recover when a database is not properly closed because of premature program termination. Consult the index by entering "premature" for more details.
At many of the prompts in JESS programs you can get assistance by typing H (for HELP). Information relating to the requirements for input at that prompt will then be displayed.
At many of the prompts in JESS programs, you can escape and return to the previous prompt by typing B (for BACK). Your previous response can thus be corrected. In this way, it is often possible also to reverse a sequence of responses. Simply, enter the BACK command repeatedly until the earlier prompt you require reappears.
The JESS prompt character is normally the colon (:) though a question mark (?) is also sometimes used. If your VDU cursor is positioned to the right of such a character, the program is waiting for you to respond. In an attempt to reduce the amount you have to do, JESS will often display a so-called "default response" at the end of the prompt (enclosed within < and > characters). Just pressing the ENTER key will impose this default as your response. If the default is not suitable, simply type the correct response instead.
JESS subjects all your interactive responses to a number of checks. If you enter something that the program identifies as incorrect or finds to be unrecognisable, a message will displayed attempting to explain what the problem is. At any prompt in a JESS program you can get information regarding the type of input which is expected at that point by typing "??" (without the quotes). The program will display criteria being applied to check your response. It will also reveal the 'override' commands that are currently permitted (this refers to commands which are explicitly allowed even though they do not conform with the usual criteria for acceptable input at that stage).
The responses that you provide at JESS prompts can often be abbreviated. If entries do not match existing data items, an attempt is generally made by the system to expand them appropriately. In most cases, you abbreviate entries by truncation (i.e. you enter only some initial characters of the full response). Note, however, that the literature database system (JLR) has a more sophisticated method of abbreviation. Consult the index by entering "JLR + abbreviation" for further details.
The responses that you provide at JESS prompts can often be entered without regard to the case (uppercase or lowercase) of the alphabetic characters. Note, however, that the literature database (JLR) and the resident-data (RSD) subsystems have methods of abbreviation that are case-sensitive. Consult the index by entering "JLR + abbreviation" for further details about the former.
It is possible to enter a great variety of 'characters' from a normal computer keyboard. In computing jargon a 'character' can mean a number of things. For example, it may mean an alphabetic letter (i.e. A to Z or a to z) or a digit (i.e. 0 to 9) or a punctuation symbol (e.g. ,;:?!*). All of these are so-called 'printable' characters, i.e. they have some widely-recognized symbol. However, the term 'character' also refers to special codes (often called 'control characters') which are only recognizable by a computer and which do not have a simple printable symbol. For example, when you press the ENTER key on a computer keyboard you are actually sending a signal much like happens with any other character but with the special meaning "take the preceding string of characters, interpret it and act accordingly". For a number of reasons, not the least of which is the need for JESS to run in the same way on different computers, JESS only recognizes a certain set of characters. They are all printable characters and there are 94 of them. It is evident that this includes most of the characters on your keyboard, so there are in fact few restrictions. There are three important classes of JESS characters. First, there are the 'fixed' characters with (almost) universally agreed symbols. These comprise the vast majority of JESS characters (85 to be exact). They are: A. The upper case letters: A,B,...,Z B. The lower case letters: a,b,...,z C. The digits: 0,1,...,9 D. The punctuation symbols: _-',;:.+*/=()[]<>?!"%& and blank. The second class of JESS characters comprises what we call the "variable" characters. There are 5 of these. On most computers they correspond to the symbols @#{} and $. However, these characters are avoided where possible because they sometimes appear differently on different computers. Their main use is internal to JESS. Lastly, there are the JESS 'special' characters. There are four of these and they are most frequently represented by the symbols |~^\ and (but, again, they well appear differently on your computer system - you can easily establish how they look by executing the JESS editor, JED, and entering the HELP command). Despite the possible variation in their appearance, the JESS special characters have the same function under all operating systems that support JESS. They are typically used as 'delimiters' indicating the beginning and end of a string of characters or where special meanings are required, as in editing.
JESS programs are often 'command-driven', i.e. you choose from a set of available commands to tell JESS what to do. These commands can usually be abbreviated, i.e. truncated. In most cases the first letter of the command will be unique and therefore sufficient. Commands can generally be entered in either upper or lower case. The first thing that JESS does when you respond to any prompt is to check that the characters you have entered belong to the JESS character set. Any non-JESS characters are automatically removed and replaced with a blank. Processing then continues, including a variety of other checks. Data other than commands can also often be abbreviated. Sometimes this involves special abbreviation rules that are more complicated than simple truncation. These cases are fully described elsewhere, each in their own context. Situations may arise when abbreviations are inappropriate or upper and lower casing is important. The usual JESS checking procedures detect responses that are incorrect in this sense; a message will then be issued and the prompt redisplayed.
Numerical responses to JESS prompts can generally be given in any of the usual computer formats that are suitable. Entering integers and real numbers An integer is a whole number (positive or negative) without a decimal point or an exponent (e.g. -5, 15, 10000, 365). If an integer is required at a JESS prompt, it must be entered as such. Real numbers on the other hand can be entered as integers (if they are non-fractional) or as a number with a decimal point and/or with an exponent. You enter a number with an exponent by using the letter 'e' or 'E' to separate the mantissa from the exponent. For example, 0.001 and 1.0E-3 are both acceptable as real numbers. Note that the mantissa MUST always be non-zero and that large numbers should not contain punctuation (i.e. commas or periods) indicating thousands. Upper and lower limits Checks are generally made to ensure that numerical values you enter fall within set limits. This is to avoid input which may subsequently cause problems. The extreme limits for integer values are roughly -2.1E9 and 2.1E9. The extreme range for real numbers is roughly -1.0E38 to 1.0E38 excluding the range around zero from -1.0E-37 to 1.0E-37. More restrictive limits are often imposed at specific prompts. For example, if JESS prompts you for an ionic strength, the acceptable range may be reduced to, say, 0.0 to 10.0. In certain circumstances you may override these programmed limits. You do this by preceding the number that you enter with an exclamation mark (!). However, you should be sure that you know what you are doing before you decide to override any programmed limit; they are there to guide and protect inexperienced users. Entering more than one value Sometimes it is necessary/convenient to have two or more values input at a single prompt. In such cases the values are simply separated from one another by commas. Spaces around the commas are ignored. For example, the following would OK (just before pressing ENTER) Enter X and Y coordinates <1.0,7.5> : 2.0, 9.7 Note that if either or both of the defaults are suitable, they may be imposed. By entering ",9.7" (to input X=1.0 and Y=9.7), or by entering "2.0," (to input X=2.0 and Y=7.5) you enter one or the other. Just pressing the ENTER key would impose both (X=1.0 and Y=7.5).
You will surely interact with many files on your computer whilst using JESS. Often these operations will be transparent to you and you need have no knowledge of either the location of the files on the computer system or of the names they are given. Sometimes, however, you will need to interact with certain files specifically. Each file that exists on your computer has its own unique "system specific" name, i.e. the name which your computer itself identifies with that file. And, obviously, each different computer has its own characteristic way of naming files. However, JESS has its own system for naming files which is simple, easy to use and is the same on all computers on which JESS is loaded. Thus you need rarely concern yourself with the system's file naming conventions whist using JESS programs. A full JESS file name has the form: DIRECT/FILNAM.EXT where DIRECT indicates the directory in which the file resides, FILNAM is the specific name of the file and EXT is the file name extension. The following sections describe what you need to know about each of these parts of the full file name. Directories A 'directory' is, in effect, a named area of storage in which many files may reside. (The name 'directory' comes from the need to 'look up' these names in the management of the files. Under the Windows operating system, 'directories' are often referred to as 'folders'. You will normally have an allocation of file storage space on the computer available for your own use. Files created by you (e.g using JESS) will generally reside in this space, which we may call your 'user directory' (to contrast it with directories used specifically by JESS). If the directory is not specified as part of a JESS file name, JESS programs assume that the file location is in the "current default directory" (i.e. normally a user directory). On the other hand, when a directory name is specified as part of a JESS file name it refers to one of a number of JESS-specific storage areas. These directory names are: ARCHIV BUILD CODMAP DEVTST ESTA FIZDTA GEM HELP INDEP JOINT KINET LISTS MIMCOD NETWRK OLDCOD PRJECT QUANTA RECIPE SOLDTA TAGSCR USER VEWDTA WORK XQT ZIP The particular purpose of each of these directories is not important to most JESS users. An outline can be found in the JESS documentation available elsewhere: JesDoc\Manuals\Users\Useful in particular. However, occasionally you may need to access explicitly files that reside in one or more of these directories. The USER, WORK and NETWRK directories, in particular, can be used as temporary working areas in some special circumstances. Since each directory name begins with a different letter, just this first letter suffices. For example, N/MSG.WRK refers to a file in the JESS directory called NETWRK. No distinction is made in JESS file names between upper and lower case letters. You should note that the JESS directory system is a "virtual" one i.e. the files may not necessarily reside in 'real' directories with the above names. This is simply because the real names differ from one computer operating system to another and must be adapted to support the JESS directory and file-naming conventions. However, to you the user, it will appear as though the files reside in separate directories with the different JESS directory names. File names JESS file names may be from 1 to 6 characters in length. The first character must be a letter of the alphabet but subsequent characters may be either letters or digits. No type of character other than letters or digits is permitted. No distinction is made between upper and lower case letters. For example, the following are all valid as JESS file names. METLIG data1 data2 A B C q00000 File name extensions These are used to indicate the type of file (i.e. usually indicating the kind and form and, perhaps, purpose of the data it contains). The permitted JESS file extensions are as follows. ARC BAT CSV DDD EST FOR GPH HTM IND JNL KEY LOG MSG NET OUT PRG QQQ RES SOR TXT USE VDU WRK XXX ZZZ During normal operations you will only come across about half of these and you will need to know about even fewer. The meaning of each extension and the corresponding file types are described in the JESS Developers Manual. Again, since each extension begins with a different letter, they can be abbreviated. For example, N/MSG.W refers to a file with the JESS extension WRK. Also, the comments regarding 'virtual' versus 'real' properties of names made above for directories apply equally to file names. Note especially that on computers running under the Unix operating system, a single letter is used as the real file name extension.
In response to any prompt for a file name by a JESS program you may enter either (i) a JESS (virtual) file name or (ii) the name of the file as it occurs under your operating system enclosed in quotation marks. You can obtain details on the way JESS (virtual) file names are formulated by searching the index for "file + name" (without quotes). Prompts for file names may provide either a default file name or a default extension or both. You then need to respond appropriately, either (i) entering both parts of the name or (ii) omitting one or other or both parts to accept the respective default(s). Note that, in response to prompts for file names, only files of a certain type are likely to be appropriate. Accordingly, if you enter a file name with an inappropriate extension the program will diagnose an error and issue the file name prompt again.
Many JESS programs are, at least in part, 'command driven'. This means that you enter a command (i.e. a word or several words) with a pre-defined meaning that instructs the program on what to do next. The power and speed of command-driven programs constitutes a very great advantage. Most sets of commands are specific to the particular context in which they are used. You have to familarize yourself beforehand with what they are and what they do. This is the downside of command-driven programs. However, there is considerable consistency amongst JESS programs, with a number of common commands having the same meaning or effect regardless of the context or of the program concerned. Consult the index searching for "use + command" for further details.
At any JESS prompt you can direct the program to take its input from a named sequential file rather than from entries typed by you. This is accomplished by entering "||||file" (without the quotes) where 'file' represents the name of any valid file. The input will then be read from the file, with each line in the file corresponding to a response as if it were being entered by you at the VDU. This continues until the last line in the file has been read and submitted to the program. The default filename extension ".VDU" is used for files that provide input in the manner described above. Consult the index using the search term 'journal' for further information about the application of this facility with those programs (such as JED and UPDJTH) which keep a record of their interactive input. Use the search term "file + output" for information about keeping a record of interactive output (i.e. any program-generated output displayed at the VDU).
There are two important interactive facilities by which files of JESS program input and output can, in general, be created. Program log-files You can keep a record of all I/O (i.e. both the input that you type and all subsequent program-generated VDU output) by entering (without quotes) "|||||OPEN" at any prompt. All I/O is then written to a sequential file named "prog.LOG" where 'prog' represents the program name. This can be very useful, particularly for recording large amounts of output that rapidly scroll off the top of your VDU screen! You can suspend this record of I/O by entering "|||||SHUT" at any prompt. The record can then be resumed by another "|||||OPEN". (The log-file is not, in fact, closed until program termination.) Note that you cannot use this facility if a program log-file already exists (from a previous execution of the same program). You can delete the previous log-file on-the-fly by entering "|||||KILL" but the onus is on you to ensure that you no longer have need of it! Journal files Some programs, such as JED and UPDJTH, maintain a record of everything that you type during the session. This record is known as a 'journal'. In the event that the program session is interupted you may be able to avoid losing all your work (if this file remains intact). In general, you do this by renaming the journal file and using it as input when you rerun the program in question. It is usually very important in these circumstances to ensure that the initial status of the program and its data is exactly as it was before your aborted session commenced. The default filename extension ".JNL" is used for files that record input in the manner described above. Consult the index using the search term "input + file" for further information about how to make the program accept its input from your journal file (after it has been renamed from *.JNL to *.VDU). Consult the index using the search term "premature termination" for more detail about how to deal with computer crashes etc. when you are using JED and UPDJTH.
There are many contexts within JESS where you must be able to alter data stored by the computer. Sometimes this can be achieved by having you respond to a sequence of prompts but often (when there are many permutations that could possibly be required) changes by interrogation are just too cumbersome and restrictive. In these circumstances, we use the general JESS editing factility, based on JED, to input or modify the stored data. Accordingly, you must learn how to use the JED editor before you attempt any modelling. Whilst the operations you need to know about are relatively few and simple, it will take a little time and effort on your part to master them. Newcomers to JESS who do not familiarize themselves with JED before they plunge into equilibrium calculations find that this is one of the quickest ways to get frustrated with the system! There are three important steps for beginners to take so that they avoid this frustration. First, read everything you can find about the JED editor by consulting the index (using the search term "editor"). Secondly, study the 'Text Editing' document in the JESS Primer. Thirdly, develop your editing skills by practising with JED (and working in an empty directory). You do not need to spend a lot of time on this but don't try to skip it altogether! The JED editor is a line-based facility - it operates on text which is stored as a sequence of one or more lines, generally up to 72 characters in length. This makes it relatively easy to learn to use compared with a word processor but it also limits what can be done with it. These limitations will be less painful if you remember that they arise almost entirely because of the need for a standard editing environment which can be implemented on many and varied types of computer. On the other hand, many of the editing operations you require for modelling and other purposes can be performed easily and rapidly using JED. With experience you will find that it has a wide variety of powerful features which compensate for its handicaps.
JED operates in three 'modes'. These are (a) an input mode in which new lines of text are entered, (b) a line-editing mode in which lines of text are individually modified and (c) a modify mode in which one or more lines are processesed collectively. It is important for you to recognize these modes because they arise differently during your modelling (depending on the context of the changes which need to be made) and you must then of course respond appropriately to each of them. The input mode arises either automatically (when there is no pre-existing data to edit) or when you select it (using the JED command "Input"). It is indicated by the prompt "Input: ". The line-editing mode arises either automatically (when there is pre-existing data to edit) or when you exit from the other two modes (input mode and modify mode). It is indicated by the prompt "Jed >" which is displayed immediately below the line itself. The line number is shown at the front of the line and may be either an integer or an integer followed by one to three lowercase letters. The modify mode arises either automatically (when there is pre-existing data to edit, and usually only a few lines of it) or when you select it (using the JED command "Modify"). It is indicated by the prompt (spread over two lines) "Mod Cmd >". Instructions on how to respond to JED in each of the above modes are given as a summary in the JESS Primer.
Your use of JED will mainly involve simple operations such as the input of data, on-the-line editing, location of text and substitutions. However, there are a number of powerful facilities which you should be aware of so that you can find out how to use them when the need arises (by searching the index for "edit + commands"). Using JED you can: 1. Access text in other files, i.e. either display it or import it into the file you are editing. You can even delete the external file from within JED if you so choose. The import of text is accomplished using the JED command "Get"; the deletion of external files is accomplished using a special form of the JED command "Delete". 2. Create an external file by writing text to it from the file you are editing. This is accomplished using the JED command "Put". 3. Operate on columns of text in the file you are editing. This includes shifting the columns to the left or right, interchanging columns, inserting text into a column, overwriting a column with a given bit of text, copying one column to another and so on. This is accomplished using the JED command "Format". 4. Operate on paragraphs of text. This is accomplished using the JED command "Modify". The modify-command "Wrap" can be used to pack words onto lines that fit between specified columns. 5. Record commands so that they can be re-performed successively by just a couple of keystrokes. This is accomplished by the JED commands "Keep" and "Xqt". The facility is very convenient, for example, when you need to make the same change to many lines but cannot do so by a substitution - you simply "Keep" the editing command and then repeatedly "Locate" and "Xqt".
The JED commands consist of 23 named (or alphabetic) operations as well as a number of non-alphabetic commands. The general rules describing their operation are as follows. The "File : " Prompt File names are entered in the usual JESS way. More information about this can be obtained by searching the index for "file + convention". You can either use a standard JESS file name (i.e. in the form dir/filnam.ext where 'dir' and '.ext' are optional) or a computer specific file name can be entered, enclosed in quotes. If the file already exists, it is read and loaded into the JED buffer file - the file on which you actually work. If the file does not yet exist, you immediately get prompted to enter the data it will contain, thus Input: _ You then type the first line and press ENTER. (This continues until you have finished the input and type "E" for "End" - without quotes.) The Alphabetic Commands You enter all the alphabetic commands in response to the JED prompt: Jed > _ The first character of the alphabetic command must be separated from the > character by exactly one space. This is the position of the cursor when the prompt is first displayed. Command Structure All JED alphabetic commands have the same structure. This is as follows. Jed > operation range |string-1|string-2| where the solidus, |, is the first of the 'active' JED delimiter symbols. (You can check this using the JED command "help" - the first delimiter symbol is also used for on-the-line input.) All the commands that you type are implemented only when you press the ENTER key. Some commands only require/allow the operation to be specified; with others you enter only the operation and the range. The blank spaces shown in the command structure above are not necessary. Operations You can abbreviate each of the 24 alphabetic operations of JED to a single letter (in either upper or lower case). The basic commands are: Advance Backward Copy Delete Help Input Join Locate Modify Quit Substitute Transfer View The remaining, more advanced, commands are: Format Get Keep Next Put Reset Undo Wrap Xqt Yield Zip There are also more advanced facilities associated with the basic commands Copy, Delete, Input and Quit. A detailed description of these alphabetic commands can be found by searching the index for "JED + commands" (without quotes). Ranges You often need to qualify a command by specifying the range of lines over which it is to have effect. A single line is specified by typing the corresponding line number. Line ranges are indicated by two line numbers (at the lower and upper extremes of the range) separated by a colon (:). For example, Jed > D5 deletes line 5 Jed > D5:10 deletes lines 5 through 10. There are two conventional symbols which you can use when specifying a line range. These are: . (period) which means 'the first line' and * (asterisk) which means 'the last line'. Note that if a line number is omitted from a line range, JED assumes you mean the current line (i.e. the line last displayed on your screen). For example, Jed > D:* deletes all lines from the current to the last. Similarly, if you altogether omit the line range and a line number is expected by JED it will assume that you mean to operate on the current line. String Fields A few commands require you to specify certain extra information. This is enclosed within the 'active' JED delimiter symbol | (the solidus). The only basic command that requires BOTH string fields is Substitute. In this case you must supply the character string to be located and the one with which it is to be replaced. Another basic command that requires a string field is Locate. In many of the more advanced commands the string field specifies an external file name. In these cases a standard JESS file name or a computer specific name can be entered (with the latter enclosed in quotes, as usual.) Displaying The easiest way to display a line is to enter its line number directly (assuming you know it). Similarly, you can display a consecutive set of lines by entering its line number range. You can also use the Advance and View commands to display the lines either following or around the current line respectively. The current line is always the last line displayed immediately above the Jed > prompt. The Backward command can be used to display the line immediately before the current one. If a line is too long to be displayed entirely on the screen this is indicated by an exclamation mark (!) appearing in the first position of that line as it is displayed on the screen. The characters on the line but not appearing on the screen can be treated as existing and can be operated on with all the usual JED commands. However, it is best to avoid lines with more than 72 characters if possible. Inserting There are four ways in which you can insert lines into a file that you are editing with JED. These use the Copy, Input, Transfer Get commands. In each case, the insertion occurs immediately AFTER the current position (i.e. following the last displayed line). There is one exception to this: if you want to insert lines BEFORE the first line of the file you need to (i) display the first line of the file, (ii) use the Backward command - so that the message "Start" is displayed - and (iii) then use any one of the above four commands to insert the new text. JED assigns a unique line number to each new line. If lines are entered after the last line of the file they are given succeeding, integral values. Whenever lines are inserted between two old ones, JED assigns a special kind of line number to them. This comprises an integer (taken from the previous line) and one or more appended (lowercase) letters. These letters are chosen so that the gaps between line numbers remains as large as is conveniently possible. Foe example, if you insert two lines between lines 8 and 9 they will be numbered 8i and 8r. Don't be confused by this; use them just like any other line number. This approach has a useful advantage: line numbers, once assigned, remain associated with the same line throughout your editing session. However, if you wish to generate a new sequence of integral numbers for all lines in the file simply enter the next command and then press ENTER (in response to the file name prompt). This updates the file and re-loads it (with new line numbers). Searching You use the Locate command to search a specified range of lines for a word, phrase or any other string of characters. You can also use the Substitute command to replace ALL occurrences of the first string you specify with the second you specify. (There is no way to replace only the first occurrence of the string found on each line so you must ensure that string you specify is sufficiently characteristic. Remember the Undo command if you make a mistake in this rrespect!) Note that the Locate and Substitute commands differ in the search that each performs: with Locate, alphabetic casing is not taken to be significant whereas with Substitute it is. Also, depending on the command format used, Locate can search for (i) the first occurrence in the range of the string specfied, (ii) all occurrences in the range of the string specified or (iii) the next occurrence of the string last specified using Locate. How the Locate command is formatted can be found by searching the index for "JED + commands". The Non-Alphabetic Commands The non-alphabetic JED commands are those which are not preceded by one of the 24 alphabetic commands listed above. They consist, instead, of a set of special instructions for performing a variety of useful operations. Simple Display Commands Typing a 'null response' (i.e. pressing the ENTER key without entering anything else in response to the Jed > prompt) causes the next line to be displayed. Typing only a line range causes the lines in that range to be shown. For example, Jed > :20 displays the current and subsequent lines up to 20 Jed > .:* displays all lines in the file A more advanced use of this display facility allows you to inspect a range of lines in an external file. This is done by appending the external file name in the same way as in the advanced commands Put and Get. For example, Jed > .:20|file displays the first 20 lines of the named file. Since it is sometimes necessary to align tables of text or numbers in certain columns, there is a special facility to assist you with this task by displaying a string of digits to indicate column positions immediately above the displayed line. You simply enter : (a colon), which is otherwise redundant. Thus, for example, if the current line is numbered 12 Jed > : 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12 The current line is re-displayed here On-The-Line-Editing It is often desirable to make minor changes to the current line without having entirely to re-type it. Such editing is done by typing certain special instructions immediately below the line. You can obtain full details by searching the index for "JED + on-the-line". It is important to remember that these special instructions are assumed to be in force whenever TWO OR MORE BLANK SPACES occur immediately after the normal Jed > prompt. (Only the second of these blank spaces is entered by you since the first is put there automatically by JED. Changing a JED "Active" Character Typing one of the four current "active" JED characters immediately followed by an equals sign and another character causes the last character to replace the first in all subsequent operations of the current JED session. For example, Jed > |=^ replaces | with ^ This facility is rarely required (except when JESS is being implemented on a computer system for the first time). Avoid it unless you know exactly what the consequences will be. Special JED Commands There are certain special commands incorporated in JED for debugging and development purposes. They all commence with ! (exclamation mark). They are: !FILE - displays the name of the file currently being edited !KILL - terminates the editing session ("with extreme predjudice" in Unix jargon). NOT RECOMMENDED! !QUEUE - permits JED-JIF queue selection and display; queues 1-3 are used by the Modify command sub-editor, queue 4 is used to store the reversing actions required by the Undo command. !DEBUG - displays the whole JED-JIF, record by record. Casing is not significant but these special commands cannot be truncated (to avoid accidents). With the exception of the !FILE commands it is inadvisable to use these commands unless you are sure you know what you are doing (e.g. some take a long time and produce copious output).
The four JESS special characters used in on-the-line-editing are represented below as | ~ ^ and \ (solidus, tilde, circumflex and backslash). Make sure that you have identified these symbols correctly - mistakes in this respect are one of the commonest problems encountered by first-time users of JED. The following operations can be performed. 1. Overwriting rest of line: two consecutive | symbols followed by a string of characters causes the existing line to be replaced (with the string of characters) from the point directly above the first | symbol. Two consecutive | symbols by themselves cause the existing line to be truncated. For example. 1 In language, clarity is everything (confucious) Jed > ||. Confucius. 1 In language, clarity is everything. Confucius. 2. Insertions: all text placed between two | symbols is inserted into the existing line immediately in front of the character directly above the first | symbol; text in the existing line on the right hand side of the insertion is shifted an appropriate number of columns to the right. For example. 1 In language,clarity is everything (confucious) Jed > | | 1 In language, clarity is everything (confucious) 3. Deletions: any character directly above a ~ symbol is deleted from the existing line; text on the right hand side of the deleted character is shifted the appropriate number of columns to the left. For example, 1 In language, clarity is everything (confucious) Jed > ~ 1 In language, clarity is everything (confucius) 4. Blanking out: any character directly above a ^ symbol is converted to a blank. For example, 1 In language, clarity is everything (confucius) Jed > ^ ^ 1 In language, clarity is everything confucius 5. Changing case: any alphabetic character directly above a \ symbol has its alphabetic case changed. For example, 1 In language, clarity is everything confucius Jed > \ 1 In language, clarity is everything Confucius 6. Overwriting single characters or strings: all non-blank characters (other than the four |~^\ symbols) are superimposed on the existing line in the position directly above where they are typed. For example, 1 In language, clarity is everything Confucius Jed > . . 1 In language, clarity is everything. Confucius. It is possible to perform multiple operations on the existing line. For example, 1 In language,clarity is everything (confucious) Jed > | | . ^\ ~ . 1 In language, clarity is everything. Confucius. Where possible conflicts arise in the implementation of these on-the-line-editing rules they are resolved by applying the rules in the order given above from 1 to 6. These on-the-line editing operations can be cancelled (and the line re-instated to its condition prior to the edit operation) by using the Undo command.
The full set of JED alphabetic commands is as follows. All of them can be abbreviated to a single letter. Spaces (e.g. between the command and the range) are optional. Anything else that is optional is shown below in square brackets. The | symbol (the solidus) is used as the JED delimiter symbol. You should search the index for "edit + rules" to obtain the general rules governing the use of these commands and how line ranges are specified. ADVANCE Syntax: Advance Function: Scrolls onward from the current position, displaying approximately 20 lines. BACKWARD Syntax: Backward Function: Displays the line preceding the current one, if there is one; if the current line is the first, the 'start of file' indicator is shown. Lines inserted at this 'start of file' position occur BEFORE the first line. COPY Syntax: Copy [range] Function: Copies the lines in the specified range to the current position; they are inserted AFTER the current line; if no range is specified, the current line is assumed. DELETE Syntax: Delete [range] Function: Deletes the lines in the specified range; if no range is specified, the current line is assumed. FORMAT (advanced) Syntax: Format range Function: Performs a variety of formatting operations on each of the lines in the specified range; the operations are all based on column ranges defined by you in response to a series of prompts; the operations which can be performed on such column ranges are as follows. Copy: Copies all the characters in a specified column range to another specified position. Delete: Deletes all the characters between specified columns; characters further to the right are shifted left by an appropriate number of columns. Input: Inserts a specified string at a specified position; characters to the right of this position are shifted further to the right by an appropriate number of columns. Modify: Modify sub-editor mode implemented between specified columns; a full description appears below; you are advised to ignore this option unless you are a very advanced user! Overwrite: Overwrites the characters starting at a specified position with a specified string. Reversecase: Reverses the alphabetic casing between specified columns. Shift: Shifts all the characters in a specified column range to the left or the right by a specified number of positions (negative for left, positive for right, default = 5) Transfer: Transfers all the characters in a specified column range to another specified position. The HELP commands provides some limited help information on the FORMAT operations; QUIT exits from FORMAT mode. Usually, you exit from FORMAT mode automatically after your required operation has been completed. To prevent this you can enter the command Noautoquit The FORMAT MODIFY option is for very advanced users only. The required columns are loaded into the Modify subeditor. On exit the lines are taken individually and inserted instead of the original characters in the column range. (The effect is similar to that of Substitute.) This facility can be used to shift columns vertically with respect to the original lines by inserting and deleting lines at the top and bottom of the set being Modified. Note, however, that if lines are only deleted while in Modify mode then the column range for the final lines of the original set will simply be deleted and, if lines are only inserted, the extra (remaining) ones are just discarded. GET (advanced) Syntax: Get range | file Function: Gets lines in the specified range from the external file and inserts them AFTER the current line. HELP Syntax: Provides some limited help information about various JED operations and commands. INPUT Syntax: Input Function: Puts JED into a text-accepting (input) mode; new lines can thus be entered into the file; input is terminated (only) when you type End as the only thing on the line, commencing in column 1; the newly-entered lines are inserted AFTER the current line. Syntax: Input range (advanced) Function: Permits you to re-instate any lines in the specified range that have previously been deleted; you are prompted repeatedly for confirmation. JOIN (advanced) Syntax: Join [range] |string[|] Function: Appends string to the end of each line in the specified range; if no range is specified, the current line is assumed. KEEP (advanced) Syntax: Keep Function: Stores the last-entered command in a "keep buffer"; this command can then be repeated with a minimum of keystrokes using the XQT command. LOCATE Syntax: Locate range |string[|] Function: Locates the first line in the specified range that contains the string; for the purposes of this search alphabetic casing is NOT regarded as significant (cf the Substitute command). Syntax: Locate range |string|| Function: Displays ALL lines in the specified range that contain the string; again, alphabetic casing is NOT regarded as significant. Syntax: Locate Function: Displays the NEXT line containing the string that was previously specified in one of the above forms of the Locate command. MODIFY Syntax: Modify [range] Function: Invokes the JED Modify sub-editor on the specified range. This supports a simple editing sub-system with certain basic operations on a sequence of lines without line numbers. The following operations are available. (i) All on-the-line edit operations using |~^\ symbols and (ii) Back, Copy, Delete, Format, Help, Input, Put, Quit, View and Wrap functions. None of these Modify commands may have a qualifier; they have the same effect as when used after the Jed > prompt except that Quit returns control to the normal JED (line editing mode), implementing the changes made. To avoid the implementation of changes made under the Modify mode enter Q|U (for Quit|Undo) instead of Quit. (iii) . displays the first line and * displays the last; and, for advanced users only, there are a number of "cut-and-paste" operations that enable you to move lines around or manipulate their order. A number of special symbols are used for this purpose " - copy current line to (end of) queue / - transfer current line to (end of) queue & - transfer (first) queue line to current position ! - delete (first) queue line $ - display all lines presently in queue NEXT (advanced) Syntax: Next Function: Terminates the editing of the current file, implementing the changes you have made and prompting for the next file to be edited; if a null or blank response is given at the prompt for the name of the next file, the file just edited is used again - thus providing a convenient way of updating the external version of the file. This may be useful either to re-number lines or to ensure that all editing changes take effect even if JED should terminate prematurely (e.g. because of a power failure). Syntax: Next|Undo Function: As above, except that the editing changes are NOT implemented. PUT (advanced) Syntax: Put range |file[|] Function: Puts the lines in the specified range into a newly-created external file; no other file of the same name may already exist. QUIT Syntax: Quit Function: Terminates the editing session normally; any changes that have been made during the session are implemented. If you wish to terminate the editing session WITHOUT implementing any changes you can use Q|U (for Quit|Undo). Confirmation of your intention to abandon all the changes made during the session is requested. It is also possible to save the 'journal file', JED.JNL, which is a complete record of all the entries you made during the editing of the current file. You can obtain details of how to use this file by searching the index for 'journal'. A more advanced facility, Q|S (for Quit|Save) allows you to save the file in which your editing changes are actually implemented as you make them. This file is called JED.USE and, if encountered when JED is run subsequently, will be used by JED automatically instead of JED requesting the name of the file to be edited. This facility is of most use when you are repeatedly editing a (single) large file because the time-consuming mounting of the file is avoided. RESET (advanced) Syntax: Reset Function: Permits on-the-line editing of the command currently stored in the 'keep buffer'. Press ENTER to exit. See the KEEP and XQT commands for the full context. SUBSITUTE Syntax: Subsitute range |string-1|string-2[|] Function: Substitutes all occurrences in the specified line range of string-1 with string-2. Note that for the purposes of this search, alphabetic casing IS regarded as significant (c.f. the LOCATE command). TRANSFER Syntax: Transfer range Function: Copies lines in the specified range to the current position then deletes the specified range. UNDO (advanced) Syntax: Undo Function: Successively reverses the changes made by previous operations of the current editing session. Changes made by the Modify sub-editor are treated as one. In the Modify sub-editor the UNDO command only works on the current line. VIEW Syntax: View Function: Displayys lines surrounding the current position without altering the current position (i.e. the current line is re-displayed. WRAP (advanced) Syntax: Wrap Function: Arranges words (in a single paragraph) to fall between specified margins. ONLY AVAILABLE IN MODIFY MODE. XQT (advanced) Syntax: Xqt Function: Executes the command stored in the "keep buffer"; the command is loaded into the buffer either by the KEEP or RESET commands. YIELD (advanced) Syntax: Yield Function: Deletes the last word on the current line. ZIP (advanced) Syntax: Zip |[file[|]] Function: Invokes a previously created set of JED commands in file. The default file extension is VDU; you must enter a file name on first using the ZIP command but thereafter this name is used as a default if you just enter Z.
JESS attempts to provide the same working environment for you regardless of the type of computer on which you are working. As far as it is possible to achieve this, the goal encompasses both the behaviour of JESS programs and the response of the computer operating system to certain standard JESS commands. The standard JESS commands must, of course, be implemented in different ways on different computers but the same appearance is preserved by using a set of common abbreviations. These abbreviations include "dir" (to list the files in your current working directory), "jed" (to activate the JESS editor), "shd" (to show the name or path of your current working directory, "sht" (to display the current time), "xqt" (to execute a JESS program) and "doi" (to carry out a preset JESS procedure). Further details can be obtained by consulting the index using the search term "xqt" (to find out about program execution) and "doi" (to find out about preset JESS procedures).
The JESS environment command "xqt" is used to execute a JESS program. The program in question is specified by name, with the name separated from the "xqt" by a single space. In this way you need not be concerned with the executable codes for all the JESS programs or where they are located. The paths (and authorizations to traverse them) are handled transparently. Likewise, the links between programs and JESS data files are automatically taken care of (within the JESS environment).
The JESS environment command "doi" is used to execute a preset JESS procedure. The procedure in question is specified by name, with the name separated from the "doi" by a single space. The only JESS procedure you need to know about is the one that is used to secure your resident data (i.e. the set of files used during modelling by the GEM stage programs). You make a copy of the current data by entering the command "doi save" (without quotes). You can restore your resident data to the state it was in at the time you performed your last "doi save" by entering the command "doi rcvr". Take care NOT to enter "doi save" if anything goes wrong with your resident data. This will overwrite the previous (good) copy with a bad one.