Input to FRED can be thought of as a stream of characters that the editor first reads and then interprets. Stream directives are special characters that direct this input stream without having any effect on the editing process itself. Stream directives are also called escapes.
For example, you may have a number of commands stored in a buffer called (work). With the right stream directive, you can tell FRED to take its commands from (work) rather than the terminal. In this way, the input stream (what FRED is seeing) is diverted from the terminal to (work).
A stream directive character is typed as a letter (either upper or lower case) preceded by a special character called the escape character. The default escape character is the backslash "\", and this is the escape character used in all documentation for FRED. It is possible to change the escape character in FRED by using the O+IE command. If you wish to refer to the escape character itself and not its special meaning, you must type a pair of the characters (e.g. "\\").
The various stream directive characters in FRED are listed below.
a \b(a)\f
appends the contents of buffer (a) to the current buffer. The \F at the end of the line puts FRED back into command mode.
Once FRED has reached the end of the text in a \B buffer, FRED returns to its original source of input. The J commands can be used to return control to the original source before the end of the buffer.
\B constructions may be used recursively to any level. In other words, a buffer that has been put into the input stream with a \B may contain further \B constructions.
If an error occurs while input is being taken from a buffer, FRED will attempt to print the remaining contents of any buffers currently in the input stream, but will not execute any of those contents. This is useful in debugging buffer programs. If there are more than three lines remaining to be executed, FRED will simply print the first three lines and will print "..." in place of the rest. After this information is printed, FRED will take its next input from the terminal.
The \B construction works in both command and text input mode. If there are a set of commands you intend to perform several times, you can save some typing by putting those commands in a buffer (say (work)) and executing those commands with \B(work) whenever desired. The same principle holds if you have some lines of text that occur several times in a report (e.g. Copyright 1981, by R.VanWinkle). The repeated text can be stored in a buffer (say (lines)) and put into place by typing \B(lines) while in text input mode.
b(\L(buf))
defines a buffer called (NAME). Since the \C characters tell FRED to pay attention to case, (NAME) is not the same buffer as (name), (Name), and so on.
jp/Answer question, yes or no?/ a \R\F t/n/
This uses JP to prompt for a yes or no answer. The answer is appended to a buffer, then the T command is used to determine if the answer contained an "n".
!jrn \w
submits the current file as a batch job via the JRN command.
Note that all the special stream directive constructions are treated as single characters in FRED. Internally, they are stored as ASCII control characters that are seldom used. This means you cannot create a \C by putting a \ character in front of a C. Similarly, \\B is not the same as \C\B. \\B is two characters, a backslash followed by a B. \C\B is a single character, a \B escaped with \C.
Stream directive characters only have their special meaning when they appear in FRED's input stream. They do not have their special meanings when text is being read with the R command or written with W.
Some terminals do not have some of the special characters recognized by FRED. Because of this, FRED will accept alternate input formats for some characters. For example, \( is accepted as an alternate input form of the left brace {. A list of all stream directives and alternate character formats can be found in "expl fred escapes".
Copyright © 1998, Thinkage Ltd.