---------------------------------------------------------------- SURVEY -- z80 [Public Domain] version 1.0 06/06/86 Copyright (c) 1986 Strategic Software Services -- Sunnyvale, Ca. Author: Robert Nelson Language: z80 assembly. For: Information Exchange System (IES) If you have any comments, positive or negative, I can be reached at these systems: Mountain View RCP/M [Byron Mckay] 300/1200..........415/965-4097 Actrix Enthusiasts BBS [Andy Bajka] 300/1200........415/968-1783 Europa/Crystal Castle [My BBS] 300/1200.............408/733-1364 Release version 1.0 06/06/86 I did this for my BBS, Information Exchange System, for people to answer a simple questionnaire when they logged on as a new user. Andy Bajka mentioned that it could be useful for other applications and suggested I make it a single .COM file, so I extracted the questionnaire portion of ENTRY and came up with SURVEY.COM. This is in the Public Domain, but please note it is a copyrighted program. Enjoy. ----------------------------------------------------------------- SURVEY, originally incorporated into Information Exchange System (a BBS), is a program that uses text-file input to form a Questionnaire/Survey for the user. SURVEY can either use input files from LASTCALR of either IES or METAL, or, at present, will ask the user his name & the date. 3 programs are distributed: SURVEY.COM -- SURVEY that depends on IES LASTCALR and INSTALL.ASM information. MSURVEY.COM -- SURVEY that will work with METAL Message System and draw all data from LASTCALR. OSURVEY.COM -- SURVEY that asks for the user's name and will work with Standard CP/M. 3 files are used; LASTCALR, SURVEY.LIB and SURVEY. At location 202H is the DRIVE (0=A, 1=B, etc.) that LASTCALR is on. 203H is the USER LASTCALR can be found at. "SURVEY. " is ALWAYS in the same place as LASTCALR. At 204H is the DRIVE that SURVEY.LIB will be placed. 205H is the user to put SURVEY.LIB. Anything outputted through SURVEY is drawn from the text file "SURVEY. ". SURVEY prints everything it sees except data following questions. There are 4 recognized DATA characters: \ - defines beginning of current question. This used in case a user inputs the wrong character or enters a blank line. SURVEY keeps track and moves back to beginning of question \ also defines end of question. At the end of a question, these characters are recognized: \ - Defines single input line : - Defines simple Yes/No input * - Same, but if No, the Questionnaire is aborted (i.e. Do you want to take a Survey?\* -- If NO, SURVEY is aborted. if yes SURVEY continues, but the answer is not recorded. + - Defines single character input. Single Character definitions flow the "+". If you were to ask Are you M)ale or F)emale? The line would be defined as follows: \Are you M)ale or F)emale?\+MMale FFemale The first character, "M", following the "+" is the data character, the "Male" portion is what the actual answer is. This is done so numbered columns may be defined as: 1. Male 2. Female 3. I don't feel like answering defined as "+1MALE 2FEMALE 3No_Way!" ("_" will be converted to spaces as an update), without having the 1,2 or 3 as part of the actual answer while not being confined to "M", "F", and "N" (No_Way!). Then another "\" is added to define end of statement (unless you have used a "\" previously as a single line input). The definition then follows. In the file, the question might be "What Sex are you?" The file definition may be "Sex:", defined as \What Sex are You?\\Sex: \ Where the question is "What Sex are You?" The Statement calls for a single line input The file definition is "Sex: ". If the user types "Male", it is entered in the file as "Sex: Male", rather than "What Sex are You? Male". All Question lines are ended with a "\", mainly for clarity. Question data may be more than one line, but NEVER let it go past 1024 bytes -- the buffer Question buffer is exactl 1k long, and will crash if it goes past that amount. \What is your age: A. 1-9 B. 10-15 C. 16-20 D. 21-25 E. 26-30 F. 31-35 G. 36-40 H. 41-45 I. 45+ J. I decline --> \+A1-9 B10-15 C16-20 D21-25 E26-30 F31-35 G36-40 H41-45 I45+ JDeclined\ Age: \ Where the whole question statement is from "What is your age" to "-->", the statement line calls for a single user-defined input ("+A" through "JDecline"), the file entry is " Age:". Note, that the line goes over 80 characters. A "Survey Error" occurs if a return is included in either the statement line or file definition. When finished, SURVEY summarizes all responses by listing the file definitions followed by the answers given, respectively. SURVEY then asks if the data has been entered correctly. If yes, all file data is Appended to the file SURVEY.LIB. If no, SURVEY is restarted from the beginning of the text-file SURVEY. -- Two examples: --- This is one I made up for a possible closed RCP/M system: Example 1: To receive full access to this system, you must be registered. ** ALL information will be kept confidential ** \Do you wish to register now (Y/n)? \* Enter Your FULL name. Although this system allows aliases, your full name must be registered: \Enter Your FULL name: \\Full Name: \ Enter your phone number in format xxx/xxx-xxxx in case it may be necessary to contact you. \ Your phone # is: \\ Phone #: \ \Enter your street address: \\ Address: \ \ Enter Your City & State: \\ City: \ \ Enter your Zip Code: \\ Zip: \ \What computer do you have? \\ Computer: \ \ What is your age: \\ Age: \ \ What Your sex (M/F): \+MMale FFemale\ Sex: \ That is all. Thank you for your cooperation! -- Example: --- This is the one I use on my system, a more message-oriented BBS. Example 2: here are a few questions to make life interesting. If you don't feel like answering, go ahead and put anything as long as it isn't obscene. \Want to answer a Questionnaire (Yes/no)? \* This is just a test-phase at the moment. If you find it useful to let other people know what you do, like, etc., and knowing about others, let me know, and I'll leave this up. \What computer(s) are you using? \\ Computer: \ \What is your age: A. 1-9 B. 10-15 C. 16-20 D. 21-25 E. 26-30 F. 31-35 G. 36-40 H. 41-45 I. 45+ J. I decline --> \+A1-9 B10-15 C16-20 D21-25 E26-30 F31-35 G36-40 H41-45 I45+ JDeclined\ Age: \ \What is your sex: M)ale F)emale D)ecline --> \+MMale FFemale DDECLINED\ Sex: \ \What are your main interests (one line)? > \\ Interests: \ \What other BBS's to you call (one line)? > \\Other Boards: \ That's it! Let me know if you find it useful. (<-- part of Questionnaire) -- End -- Usually, the best technique is to write up the text-file without SURVEY data, and then go through it adding "\"'s and whatever else is needed afterwards. Notes: If you are running Information Exchange System, make sure you've installed it with INSTALL.HEX and DDT, or an installation error will result. SURVEY depends on it to find the correct time & date. If you are running METAL, SURVEY draws all information (Name, Time/Date logged on) from LASTCALR. If you are running another BBS or none at all, LASTCALR isn't used; place SURVEY. where 202H and 203H point to.