.\" @(#)$Id: Form.guide,v 4.1 90/04/28 22:41:05 syd Exp $ .\" A guide to using the Elm Forms mode .\" format with: .\" 'troff tmac.n - > Forms.format' .\" Elm is now in the public trust. Bug reports, comments, suggestions, flames .\" etc. should go to: .\" Syd Weinstein elm@DSI.COM (dsinc!elm) .\" (C) Copyright 1986, 1987 Dave Taylor .\" (C) Copyright 1988, 1989, 1990 Usenet Community Trust .\" $Log: Form.guide,v $ .\" Revision 4.1 90/04/28 22:41:05 syd .\" checkin of Elm 2.3 as of Release PL0 .po 1i .ds h0 .ds h1 .ds h2 .ds f0 .ds f1 .ds f2 .nr Hy 1 .nr Pt 1 .nr Pi 0 .lg 0 .\" Define the big box macro for troff .de eb .sp -1 .ie t \{\ \h'-.5n'\L'|\\nau-1'\l'\\n(.lu+1n\(ul'\L'-|\\nau+1'\l'|0u-.5n\(ul' .el \{\ \h'-.5n'\l'\\n(.lu+1n' .sv |3.0i .ce 99 .ps 20 .ss 18 .vs 12 \f3Elm Forms Mode Guide\f1 .sp 3 .ps 12 .ss 14 .vs 14 \f2What Forms Mode is, how to use it to create custom forms, how to reply to forms, and how to use it for AT&T Mail messages\f1 .sp 2 Dave Taylor Hewlett-Packard Laboratories 1501 Page Mill Road Palo Alto CA 94304 .sp 3 email: taylor\s-1@\s+1hplabs.HP.COM or hplabs\s-1!\s+1taylor .sp 3 >>> Elm is now in the public trust. Bug reports, comments, etc. to: <<< Syd Weinstein Datacomp Systems, Inc. 3837 Byron Road Huntingdon Valley, PA 19006-2320 email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm .sp 3 .ps 18 \f3\(co\f1\s12 Copyright 1986, 1987 by Dave Taylor .ps 18 \f3\(co\f1\s12 Copyright 1988, 1989, 1990 by The USENET Community Trust .ps 10 .ss 12 .vs 12 .bp 1 .sv 5v .ps 14 \f3A Guide to Forms Mode in Elm\f1 .ds h0 "Forms Mode Guide .ds h1 .ds h2 "Version 2.3 .ds f0 "May 1, 1990 .ds f1 "Page % .ps 10 (Version 2.3) Dave Taylor Hewlett-Packard Laboratories 1501 Page Mill Road Palo Alto CA 94304 email: taylor\s-1@\s+1hplabs.HP.COM or hplabs\s-1!\s+1taylor .sp 2 >>> Elm is now in the public trust. Bug reports, comments, etc. to: <<< Syd Weinstein Datacomp Systems, Inc. 3837 Byron Road Huntingdon Valley, PA 19006-2320 email: elm\s-1@\s+1DSI.COM or dsinc\s-1!\s+1elm May 1, 1990 .ce 0 .sp 2 While there are a lot of mail systems that allow the transmission of text and primitive pictures, to send and reply to more complex forms is simply not possible. \f3Elm\f1, however, took the forms mode implemented as part of the AT&T Mail package and has expanded on it to be a smoothly fit part of the overall mail system. Forms mode gives you the ability to send `template' files to people and receive the filled-in replies.\s-2\u1\d\s0 \f21. note that this feature assumes that the person on the other end is also using the Elm mail system.\f1 Let's look at an example right off. Say we were going to use computer mail as a way to file defects with software. There is a certain amount of information we want to be able to collect when each report is made, and if it is in a specific format we can use programs to file the defects upon receipt. The form we'll try to emulate starts out looking like: .\" A manual page break has been done because the 'sd' macro doesn't like .\" coming up right after the footer or just doesn't like going to a new .\" page by itself. The bug has been reported. .ft CW .sd c .mk a .tl ''Defect Reporting Form'' .tl 'Program:\ \l'2.3i-\w'Program:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u'' .tl 'Operating\ System:\ \l'2.3i-\w'Operating\ System:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u'' .tl 'Defect\ Type:\ \l'2.3i-\w'Defect\ Type:\ 'u''' .tl 'Date\ Found:\ \l'2.3i-\w'Date\ Found:\ 'u'''By\ Whom:\ \l'2.3i-\w'By\ Whom:\ 'u'\h'.2i'' .tl 'Date\ Reported:\ \l'2.3i-\w'Date\ Reported:\ 'u'''Phone:\ \l'2.3i-\w'Phone:\ 'u'\h'.2i'' .tl 'Description:\ \l'6.4i-\w'Description:\ 'u'' .tl '\l'6.4i'' .tl '\l'6.4i'' .ft 1 This form can actually be created almost exactly as listed above in the \f3Elm\f1 mail system by using your standard editor and can then be mailed about as needed. Let's say that we want a bit more information, however, especially with fields like ``Defect Type'', we want to list all the recommended answers. To create the actual form, we need merely to replace the underlines in the above form with spaces. The multi-line comments can simply be indicated by a `:' by itself on a line; .ft CW .sd c .mk a .tl ''Defect Reporting Form'' .tl 'Program:''Version:\h'1.7i-\w'Version:'u'' .tl 'Operating System:''Version:\h'1.7i-\w'Version:'u'' .tl '(Valid Defect Types are: user-error, doc-error, fatal, other)' .tl 'Defect Type:'' .tl 'Date Found:''By\ Whom:\h'2.3i-\w'By\ Whom:'u'' .tl 'Date Reported:''Phone:\h'2.3i-\w'Phone:'u'' .tl 'Description' .tl ':' Thank you for filling in this form. .sp 2 .ft 1 As we can see, it is quite simple to create forms!! .sp 2 Now that we have an idea what we're talking about, let's actually officially define the system... .ne 5 .hu Forms Mode Specification [Note that this is all taken from the document \f2Standard for Exchanging Forms on AT&T Mail\f1, Version 1.9 of 6/7/86, from AT&T] The forms mode is really quite simple. Simple enough that it is amazing that it hadn't been implemented before AT&T Mail came along!! In a nutshell, each field is delimited by a `:' followed by a number of blank spaces or tabs that represent the valid size for that field. That is, if we have a line in the form like; .ti .5i ``Phone (area-code):\0\0\0\0\0Number:\0\0\0\0\0\0\0\0\0\0'' The area-code field will be limited to three characters and the number to nine. (this is kind of hard to see with the proportionally spaced formatted copy, alas). The only exception to the rule is that a `:' by itself on a line represents a field that is as large as the user entering the data desires. The actual form that is transmitted, in AT&T Mail parlance, is a ``SIMPLE'' forms handler message (as opposed to the ``ADVANCED'' handler). This means that it contains three sections; .ne 8 .in .5i .ft 2 The Message Header .ft CW [\&OPTIONS-SECTION] [\&FORMS-IMAGE] [\&RULES-SECTION]\f1 .in 0 \f3Elm\f1 generates form messages with the ``options'' section filled out, but ignores it when receiving mail. The filled out section is: .ft CW .in .5i WIDTH=80 TYPE=SIMPLE OUTPUT=TEXT\f1 .in 0 The FORMS-IMAGE section is that described above. The RULES-SECTION can contain explicit rules about the possible values of each field, but this is currently ignored by \f3Elm\f1, being a ``SIMPLE'' forms mode mail system. Forms also have the header ``Content-Type: mailform'' to indicate to the mail system (either \f3Elm\f1 or AT&T Mail) that a form is being sent. \f3Elm\f1 further indicates that a form has been received by having an ``F'' as the status character in the header display section (instead of ``N'' for new, etc). .ne 5 .hu Composing and Sending a Form The first step to enable sending forms is to change the setting of the variable \f2forms\f1 in your \f2.elm/elmrc\f1 file to ``ON''. E.g.: .ti .5i forms = ON The next step is to send the message to someone using the `m' (\f2mail\f1) command. This then will drop you into an editor. Type in the form as indicated above, with appropriate colons and comments, and end the entry by leaving the editor. The prompt is now; .ft CW .tl ''Choose: E)dit msg, edit H)eaders, M)ake form, S)end or F)orget : @'' .ft 1 so we choose `m' \(em \f2Make form\f1. The program then will either rewrite the prompt without the M)ake form option, indicating that the form has been accepted, or will indicate the problem and give you a chance to correct it. Once it has been accepted, simple use the `s' \(em \f2send message\f1 - command and it's off! \f2Note that you cannot reply to a message with a Form.\f1 .ne 6 .hu Replying to a Form Let's reply to the form message we generated now. The header page of the \f3Elm\f1 mail system will indicate that the message is a form by having an `F' next to it. So we use `r' to reply and the screen is immediately cleared and we're prompted, field by field, for the data requested. Each field has underscores in the input area to indicate the size field that is expected. After answering all the questions we'll have a screen that looks like; .ft CW .sd c .mk a .tl ''Defect Reporting Form'' Program: \f3The Elm Mail System\f1\l'3i-\w'\f3The Elm Mail System'u' Version: \f31.5\f1\l'3i-\w'\f31.5'u' Operating System: \f3HP-UX\f1\l'3i-\w'\f3HP-UX'u' Version: \f35.141 C\f1\l'3i-\w'\f35.141 C'u' (Valid Defect Types are: user-error, doc-error, fatal, other) Defect Type: \f3fatal\f1\l'5i-\w'\f3fatal\f1'u' Date Found: \f310/9/86\f1\l'3i-\w'\f310/9/86\f1'u' By Whom: \f3Dave Taylor\f1\l'3i-\w'\f3Dave Taylor\f1'u' Date Reported: \f310/9/86\f1\l'3i-\w'\f310/9/86\f1'u' Phone: \f3(415) 857-6887\f1\l'3i-\w'\f3(415) 857-6887\f1'u' Description (Enter as many lines as needed, ending with a `.' by itself on a line) \f3When running it on a CPM system I cannot compile successfully.\f1 \f3.\f1 Thank you for filling in this form. .tl ''Choose: E)dit form, edit H)eaders, S)end or F)orget : @'' .ft 1 Quite simple. Notice, however, that the order of prompting is left to right on each line, so the fields that on the form are placed in what seems like a logical place, ``By Whom:'' and ``Phone:'' turn out to be confusing when filling in the actual form since it isn't clear what ``Phone:'' is being asked for because of the intervention of the ``Date Reported:'' field. The message that will actually be sent out from this will have the fields in a more acceptable format; .\" Force page break, as there seems to be a bug in the .sd macro .ft CW .mk a WIDTH=80 TYPE=SIMPLE OUTPUT=TEXT .tl ''Defect Reporting Form'' .tl ' Program: The Elm Mail System''Version: 1.5\h'1.5i-\w'Version: 1.5'u'' .tl ' Operating System: HP-UX''Version: 5.141 C\h'1.5i-\w'Version: 5.141 C'u'' .tl ' (Valid Defect Types are: user-error, doc-error, fatal, other)' .tl ' Defect Type: fatal'' .tl ' Date Found: 10/9/86''By Whom: Dave Taylor\h'2.3i-\w'By Whom: Dave Taylor'u'' .tl ' Date Reported: 10/9/86''Phone: (415) 857-6887\h'2.3i-\w'Phone: (415) 857-6887'u'' .tl ' Description' When running it on a CPM system I cannot compile successfully. .tl ' Thank you for filling in this form.' .ft 1 .hu Comments on Forms Mode As was said at the beginning, this way of sending about forms could prove to be very helpful and useful in a variety of contexts. On the other hand, until a more sophisticated forms language is used for the forms, this should be sufficient to embody the power of the idea. I welcome any comments and thoughts on this system and also welcome possible enhancements. I also gratefully thank Dale DeJager of AT&T Information Systems for sending me more information on AT&T Mail than I could possibly digest in any finite amount of time.