\ .heading ' VATF Demo and Tutorial' .make main 17 51 .open main 0 15 .look main {bWELCOME TO THE VIDEO ATTRIBUTE TEXT FORMATTER DEMO AND TUTORIAL} {rI. Introduction} .comment 1 2 3 4 5 .comment901234567890123456789012345678901234567890 This demonstration is meant as a display of the abilities of VATF and also as a tutorial for prospective users. VATF stands for Video Attribute Textual Format- ter. As you can see just from this screen display, VATF is versatile and gives text an easy-to-read environment, as well as video enhancements such as bolding and reverse video. VATF is a directive interpreting mini-language that allows the user to manipulate the screen in many ways. .pause VATF was designed to be usable by people with a minimal amount of computer literacy or experience. Instructions (directives) are imbedded in the text, and VATF interprets them as they occur. VATF also displays diagnostic (error) messages when necessary to facilitate debugging of the program. .pause VATF can be used by instructors who want to write a tutorial, quiz, or any other utility that is to be displayed or implemented on a computer terminal. Following is a brief survey of the concepts used in the design and development of VATF. .pause {rII. Concepts} A. {uWindows} Imagine that you are facing a bare wall with- out windows and you want to look outside. First, you've got to make the window, then open it, and then look out of it. Of course, you can put in as many windows as you want, but let's suppose that the wall is only big enough to fit fifteen windows. Now, when you are finished using a window, you must close it and look through another. This is the idea behind the way VATF deals with viewing windows, using the directives .make, .open, .look, and .close. .pause B. {uText} .comment901234567890123456789012345678901234567890 Within the text, you can manipulate video attributes by using special characters. Simply type a left brace, {{ and then one of the letters b (bold), u (underline), r (reverse), or l (blink). Only one of the letters is associated with each brace, so if you wanted bold and blinking characters, you could type {{b{{l and then whatever text you want to have those attributes. The attributes are in effect until the next occurence of a right brace }}. .pause If you want a brace to appear in the text as it has here, simply put two braces next to each other. Only one will be printed on the screen. Example: {{{{ for a left brace }}}} for a right brace Remember, the right brace cancels {b{lall} active attributes, so if you want to cancel bold but not blink when both are active, you must cancel both, and then reactivate blink. .pause C. {uQuestions} .comment901234567890123456789012345678901234567890 VATF can ask multiple choice, true-false, or any other type of question that can be answered with one letter. If questions are asked, VATF creates an informative output file containing responses given by the user, whether the response was correct or incorrect, how many tries were given the user, and the percentage of the questions the user responded to correctly. .pause Now we will go into more detail on the syntax of the directives, first covering window manipulating directives, and then question and answer directives. .pause {rIII. Directives} .comment901234567890123456789012345678901234567890 In order for VATF to realize that it should be interpreting directives, the first character of the file must be a backslash (\). If the first character is a backslash, VATF will interpret directives as it finds them, otherwise it will display the text in 20 line frames. Therefore, VATF can be used to view files that do not contain directives also. .pause All directives must be preceded by a period (.) in the first column of the line. This dis- tinguishes the directive from normal text. Example: Column 12345678 .open is a directive .open is not .comment901234567890123456789012345678901234567890 Also, most directives require one or more parameters so VATF can tell what you really want and doesn't have to guess. .pause A. {uWindows} The window manipulation directives are the following: .make (make a window) .open (open a window) .look (use this window for current text output) .close (close a window) .pause .label (label a window) .heading (put a heading at the top of the screen) .pause (wait for user continuation signal) .clean (refresh a screen) .line (draw a line) .comment (ignore this line) Now we'll go into detail on the parameter's each directive requires. .pause Syntax: .make window_name rows columns *framed .comment901234567890123456789012345678901234567890 The .make directive requires three parameters; the last parameter is optional, as is indicated by the asterick. Window_name is a single word, 15 characters or less, that you want to use to refer to the window in subsequent directives. Rows is the number of rows you want the window to have, and columns is the number of columns you want. The last parameter, if there, indicates that the window should be framed. You can have a maximum of 15 windows existing at any given time. .pause Here are three examples of the .make directive: .make middle 7 30 Creates a 7 by 30 unframed window named middle. .make fred 4 58 f Creates a 4 by 58 framed window named fred. .make main 17 51 This was used to create the window that is currently being written in by this program. .pause .comment901234567890123456789012345678901234567890 NOTE: VATF is not case-sensitive. In other words, is treats the word middle the same as Middle or MIDDLE. Also note that commas are not allowed to separate parameters, but you can put as many blanks in between as you want, as long as there is one or more. All numbers must be integers. The frame you see around this window is created automatically and is named background. You can use background as you would any other window, except for a few functions such as .close, .label, and .open. .pause Syntax: .open window_name at_row at_col This directive is used to put a window on the screen so that it is visible. At_row and at_col indicate coordinates on the screen. Actually, they are used as offsets from the position of background. If a window is already opened at a position, issuing another open on that window will move the window to the specified location. .pause Here are two examples: .open middle 5 7 Puts middle at position (5, 7) relative to back- ground. .open fred 30 67 Note that this will put fred on the screen, but out of the bounds of where it is visible to the viewer. {bDon't} {bdo this!} .pause .comment901234567890123456789012345678901234567890 NOTE: If you put a window on the screen and another window occupies that space, the current .open will put it's window {lon top} of the pre-existing one, hiding it's contents. This is known as occlusion. The window labeled 'example' illustrates this. This line will get occluded by 'example'. .make example 3 40 f .open example 11 6 .label example 'Example' .look example This is over window main .look main .pause .close example d Syntax: .look window_name .comment901234567890123456789012345678901234567890 This directive will make the window window_name the output window. All subsequent text will be placed in this window until another look directive is encountered. Right now, this program is 'looking' at a window called main. Here is the directive used to achieve that: .look main .pause A note here on the width of the text in the file is appropriate. If the width of a line of text (excluding video attribute indicators) is longer than the width of the current window, the line will be truncated. The width of the window is one less than however you .make it because VATF automatically inserts a space at the beginning of each line so that text isn't crowded against the left frame, if the window is framed. .pause Syntax: .close window_name *delete .comment901234567890123456789012345678901234567890 This directive removes the window specified from the screen. If the optional delete parameter is specified, the window is deleted, making future references to that window invalid unless it is recreated. .pause Examples: .close example This removes the window named example. The window can be reopened later if it is needed. .close example d This removes and deletes example. It cannot be reopened unless it is first remade. .pause Sytax: .label window_name 'text' *pos .comment901234567890123456789012345678901234567890 This directive labels the window as you saw previously on the 'example' window. The text you specify must be enclosed in single quotes. Pos is an optional parameter that is used to indicate the position of the label. It can be either t (top), b (bottom), r (right side), or l (left side). The default position (if the pos parameter isn't specified) is on the top of the window. .pause Examples: .label main 'hello' Puts the text on the top. .label main 'main' r Puts the text on the right side. Note that if a window is unframed, labeling the window causes it to become framed. .pause Syntax: .heading 'text' .comment901234567890123456789012345678901234567890 This directive creates a heading with double-high, double-wide characters like the heading above. If there is no heading, the background window is 2 lines taller, allowing more screen for text. Again, the text you specify in the directive line must be en- closed in single quotes. .pause Example: .heading ' VATF DEMO AND TUTORIAL' .comment901234567890123456789012345678901234567890 Note that there are spaces in the text specified. This is because with the strange sizing of the letters, centering effects are difficult to predict, and those spaces help the centering. .pause Syntax: .pause This directive is used to enforce a pause in the execution. Normally, VATF will continue printing text until the window is filled, and then pause, but you may not want to have every frame filled completely. The .pause directive allows you to wait for the user to hit a carriage return at any time you want. After the carriage return has been entered, the current window is refreshed. .pause Syntax: .clean window_name .comment901234567890123456789012345678901234567890 This directive allows you to clean any window at any time. For instance, suppose you had been using the background window and now you want to use a different window, but do not want the text in the background to be there. .look background Junk like this .look main .pause To get rid of the junk, use the directive .clean background .clean background .pause Syntax: .line window orientation axis start stop .comment901234567890123456789012345678901234567890 This directive allows you to draw lines in the specified window. Orientation can be either h (horizontal) or v (vertical). The axis is the row (orientation h) or column (orientation v) where you want the line. Start and stop are the columns or rows (depending on the orientation of the line) where you want the line to stop and start. .pause Example: These directives were used to draw the lines in the background. .line background v 3 5 9 .line background h 7 1 5 .line background v 3 5 9 .line background h 7 1 5 .pause .clean background Syntax: .comment text This directive is used to insert comments into the text that can be used to document what VATF should be doing at that point. VATF ignores comment lines. .pause B. {uQuestions} .comment901234567890123456789012345678901234567890 The .question and .answer directives are used to indicate to VATF that you want to ask the user a question. They can also be used as a conditional jump to a point in the text beyond the current point. The target point is marked by a % in column 1. .pause Syntax: .question .comment901234567890123456789012345678901234567890 This directive puts VATF into question- asking mode. A window the size of background is opened, occluding all other windows, for the question to be asked in. Text is typed in from the source file until the .answer directive is encountered. You can ask a maximum of 50 questions (excluding jump questions). .pause Syntax: .answer *real_answer *num_tries *jump .comment901234567890123456789012345678901234567890 The answer directive indicates that VATF should now prompt the user for an answer. Real_answer is one character that indicates what the correct response would be. Num_tries is an integer between 1 and 15 that indicates how many tries the user should be given. It defaults to 1. Jump indicates whether VATF should jump to the next target if the user answers correctly or not. .pause The amount of information you specify in the .answer directive determines how much information is contained in the answer file. For instance, if a particular correct answer is not specified, then that number cannot be included in the percent correct calculation. The file containing the user's responses is named by concatenating the source file filename and the process name, with a file type of .ANS. .pause For jumping forward, use this format: .question Some text asking the user if they would like to jump ahead or not. .answer (y or n) 1 jump text to be written if no jump % (target) text to be written after jump .pause .comment901234567890123456789012345678901234567890 Incidentally, target lines are not printed on the screen. Also, if a jump occurs, any directives between the .answer directive and the target are ignored. The jumping option is nice, but must be used with care. .pause {rIV. Comments} .comment901234567890123456789012345678901234567890 Most of the directives are straight- forward, but some (.line, .answer, .open) take some getting used to. Just experiment with them. If you do something drastically wrong, VATF will either inform you with a diagnostic message, or crash. Either way, you'll know you've done something. .pause Diagnostic messages are given at the bottom of the screen. The following error message was generated with the following line: .notvalid command .notvalid command Messages are also given for invalid directive parameter specifications, or anywhere else VATF gets confused or annoyed. .pause .question Now, we are in question mode. The following section is a little bit of technical information on VATF. Do you want to see it? (This jump is done using an answer directive as follows: .answer n 1 jump) .answer n 1 jump .comment now we're back looking at main {rV. Technical Information} The VATF system is composed of four compo- nents. 1) Source file 2) Front end command file 3) Screen Management Environment 4) VATF code .pause 1. {uSource file} .comment901234567890123456789012345678901234567890 This is the file of texts and directives that VATF processes. It can be created using any method desirable, but it must be in simple ASCII format. We recommend using a word processor for maximum control of margins. .pause 2. {uFront end command file} This is the file VID.COM. It sets several logicals used by VATF and sets a few terminal characteristics. This can be copied and modified for specific applications of VATF. To invoke VATF, execute VID.COM with the source file name: @vid source If no file type is specified, VID.COM will assume it has a file type of .VID. .pause 3. {uScreen Management Environment} .comment901234567890123456789012345678901234567890 This is a small environment consisting of declarations for the SMG$ screen management routines on the VAX/VMS system. It also defines some constants and masks. VATF can be used on any terminal supported by the SMG$ routines. .pause 4. VATF code This is simply the executable stuff that processes the input file. VATF was written in Pascal. .pause %