On Line V1.3 By Mark Hewitt =-=-=-=-=-=-=-=-=-=-=-=-=-= First - I take no responsibility for any consequences that may occur as a result of using this programme. I have tested the program thoroughly and as far as I am awore there are no bugs but if you find any please let me know. Feel free to copy this program and distribute it among others but if you keep and use it then please send some money or some otherPD/Shareware programs to me to encourage me to write more in the future (see section 6). If you do copy it then the following files must also be supplied with it OnLineV1.3.doc, OLExample, OLPic and the program must remain unchanged. To run the programme needs the arp and power packer libraries to be in the libs draw. Thanks to all those who made these Contents ======== 1. Introduction 2. Usage - Including a sample session 3. The Menus 4. On Line V1.4 File Format (important) 5. History 6. End Note 1. Introduction =============== On Line was written mainly to test a number of routines and ideas that I had thought about. The idea of On Line is that is has the capacity to load a number of different files containing relevant data on any topic which can be accessed is a quick and easy manner. For example if you had a file containing a list of the cheat modes of up to 65536 entries of games. The following procedure would be followed: a. Enter the name of the selected game in the bottom search window and press return. b. The program will search the file for any relevant information and when the cheat mode is found it will be displayed in the top window. If a match is not found then an error message will be displayed. By creating new files for the program (see the file format section) in a word processor you could reference almost anything quickly and easily. For example in a file with English words and their French translation you could look up the translation of a word by simply entering either the French or English word and its translation would be found and displayed on the screen. With the release of On Line V1.2, I added many new features, the main one being the test section. This allows you to use any files already created as a basis for testing your knowledge on the subject of any of the files. For example this test section could be used in conjunction with the file of English words and their French translation. To test yourself from English to French and vice-versa. Another addition is you can optionally print out things (such as the cheat mode or a list of all the commands to the printer). This is useful if you need to take this information away with you as it saves you copying it out by hand. Also if the text defined is longer than the screen you would have dificulty reading it, again a printed readout helps greatly in this situation. You also have the option of showing a picture instead of some text. 2. Usage ======== 2.1 Starting up From The CLI - OnLine is optional. If you omit the filename the program will load and when loaded you will be presented with a filerequestor in which you can specify the name of the file you wish to load. If is present then the program will try and load the file automatically. NOTE: If you include a filename it must be the full path name and must not be in quotes. From The WorkBench - Double click on the Online icon and the program will load. You will then be presented with a file requestor in which you can specify the file you wish to load. 2.2 What Then You will then be shown some information regarding the number of commands recognised in the current file as well as some help text. All you need to do now is type a `COMMAND` in the search gadget at the bottom and the program will search for the related text. If the COMMAND is not recognised then an error message will be displayed (The same is true of any error). NOTE - I have designed OnLine so that uppercase and lowercase letters are treated the same Eg. The following commands would be treated as the same input: ALSO , also , AlSo, Also 2.3 A Sample session ==================== 1. Double click on the On Line icon to start the program 2. When the drive light goes out, Insert the disk with the program on, click on the drives gadget in the filerequestor and click on DF0: at the top of the window. The contents of the disk will then be displayed. Click on the OnLineV1.4 Directory on the Examples directory and then on the OLExample text. The file should then load and the files name will be displayed in the search windows title-bar. 3. When the file has loaded, some help text will be displayed as well as the number of commands that were in the file. 4. From the menus, select the ALL submenu from the COMMANDS menu item in the PROJECT menu. 5. A list of all the commands in the current file will then be shown. 6. Try entering different commands in the input window at the bottom. 7. Experiment with some of the different menu options from the first menu, these are all documented in the next chapter. 8. From the second menu, select either the second,third or forth menu options, and follow the on screen instructions. 9. Select QUIT from the menu and click on the OK gadget, you will now have left the program. 3. The Menus ============ To take full advantage of the program you will need to use the features provided by the menus. These are: The Project Menu ---------------- Load = Brings up a file requestor in which you can specify the Mnemonic (Open) name of a new file to load. When you have loaded a file you will be told its name in the title bar of the search window.You can also choose this option by pressing (R.Amiga - O) Sleep - Normal = This option will close all the main windows to unclutter Mnemonic (Normal) the screen and open a small window in the top left of the screen. The last used file will remain in memory. To open up the main windows again simply click on the close gadget of the smaller window as directed. This option would be useful if you were using another program at the same time as On Line and wanted to keep On Line running but use the other program. You can also choose this option by pressing (R.Amiga - N) Sleep - Clear = This option functions more or less the same as the above Mnemonic (Clear) except it will erase the file from memory and so freeing some memory back to the system. When you choose this menu item a requestor will open up and you will be given the chance to cancel this option. If you choose OK then the same window as described above will appear. You can also choose this option by pressing (R.Amiga - C) Commands - All = If you choose this item then all the commands that are Mnemonic (All) recognised by the currently loaded file will be displayed in the output window. You can also choose this option by pressing (R.Amiga - A) Commands -Letter= This functions similar to the above, except a window Mnemonic (Letter) will appear in which you must enter the first letter of the commands you want displayed, then press return and all the commands beginning with that letter in the current file will be displayed. Eg. If you entered `a` then all commands in the current file beginning with either `a` or `A` would be displayed. You can also choose this option by pressing (R.Amiga - L) Help = Choosing this menu item or pressing the HELP key will cause some help text to be displayed. This can be defined by the user to suit a particular file or there is some default text built in. ( See The OnLine file format section). About = This simply shows a window with some information about me (fame). Click the mouse button to close it. Quit = (Rather than making some wise comment such as durr... Mnemonic (Quit) guess). Choosing this will cause the program to quit. A window will appear and you will be given the chance to either continue with the program or to quit. You can also choose this option by pressing (R.Amiga - Q) The Test Menu ------------- Search = This menu is automatically selected and specifies that you are currently in search-mode. This will be shown by the fact that the title in the input window will show that you are in search mode. You can also choose this option by pressing (R.Amiga - S) NOTE- for the following three menus I reccomend that you experiment with the file OLExample to see what they mean. ????????? = The name of this menu will vary depending upon the currently loaded file. This is used to activate one of the test modes. It is possible that this option may be turned off to prevent the user using the test mode. Eg. if the menu reads ENGLISH and the file was an ENGLISH- FRENCH translation, as is the OLExample, then if you chose this you would be given a French word and asked for the English translation. You can also choose this option by pressing (R.Amiga - 1) ????????? = The name of this menu will vary depending upon the currently loaded file. This is used to activate one of the test modes. It is possible that this option may be turned off to prevent the user using the test mode. Eg. if the menu reads FRENCH and the file was an ENGLISH- FRENCH translation, as is the OLExample, then if you chose this you would be given a English word and asked for the French translation. You can also choose this option by pressing (R.Amiga - 2) Any = This is again one of the test modes. It randomly changes between the two previous options. Mode - Ascending= If this is selected, when you use one of the test options, it will work in ascending mode ( getting the commands in ascending order). You can also choose this option by pressing (R.Amiga - A) - Descending If this is selected, when you use one of the test options, it will work in descending mode ( getting the commands in descending order). You can also choose this option by pressing (R.Amiga - D) The Options Menu ---------------- Print = If this item is checked , any text that is printed out onto the screen will also be output to the printer. NOTE - if the printer is not online (no pun intended) then for some reason the program stops and waits until all the text has been printed. See also the NO ERRORS menu below. You can also choose this option by pressing (R.Amiga - P) No Errors = This is used in conjunction with PRINT above. If this item is checked (the default), when printing, no error messages will be printed. If this menu is not selected then all error messages will be printed. You can also choose this option by pressing (R.Amiga - E) The Extras Menu --------------- Show pic. = This item allows you to display a picture. A file requestor is shown in which you can enter the name of the picture to display. While the picture is being shown press LMB to return to the main programme or RMB to print the picture. 4. On Line V1.4 File Format =========================== Before I show the file format I will mention a couple of important points. i. Because the symbol `@` is used to define the end of text blocks in the file, it is important that they are ONLY used for this purpose and are not placed in the middle of a block of text. ii. When entering a command it must be in capitals as all user inputs are converted to capital letters. If you enter a command in the file in lower case letters then it will be ignored by the programme. iii. DO NOT place spaces after the commands or after the I.D. command in the first line of the file. If you DO put spaces then: a. In the case of the I.D. command in the first line, if you try and load the file you will get an error message saying that the file is not an OnLine file. b. In the case of a command, the spaces after will be treated as part of the command, so when using the file you would also need to enter the same number of spaces after the command in the search gadget. iv. If you intend to use the search mode working both ways or all the test menus (see point *5* below) then you must enter the symbol '@' directly after the text that is assigned to the command before pressing return. eg. BOY LE GARCON@ 'NEXT COMMAND' 'NEXT TEXT'@ .... .... v. When searching for a command, if the program finds a match that matches any of the letters eg. if you entered GAMEUHUJ then if you had a command GAME then that would be shown. Also if you had a command GA then that would be shown instead (I doubt you understood that). For this reason if you have a command where the first part is the same as another complete command eg. SHADOW OF THE BEAST and SHADOW OF THE BEAST II then this command (in this case SHADOW OF THE BEAST II ) must come before the other. See the cheat list file. If you dont do this then some files will not be able to be shown even if they appear in the list of commands. The File format is as follows. ( here goes! ) NOTE: I have included comments to show what each part means, you must not include any comments in your final file. Also I have used the symbol << to denote where you should press return, again do not include this symbol in your final file. Where you see *number* , this refers to a more detailed explaination below. OL<< ;This is the I.D. command *1* ENGLISH:FRENCH<< ;used in the test menus *2* What is the French of<< ;text for FRENCH menu *3* What is the English of<< ;text for ENGLISH menu *4* 00<< ;Mode *5* HELLO<< ;the first user command The French of Hello is Bonjour ;user text @<< ;symbol to show end of text HAVE<< ;The second command j'ai nous avons ;user text for the second tu as vous avez ;command, it can be any il/elle a ils/elles ont ;number of lines long @<< ;end of second commands text BOY<< ;the third command Le Garcon ;text for third command @<< ;end of third commands text " " ;and so on " " CHAIR<< ;the last command La Chaise ;the last commands text @@<< ;END of file (two @@) Enter an english word and then press return, the ;optional *6* French will then be displayed in the top indow ;help text @<< ;end of help text *1* This is here just so that the program can check that this really is an OnLine file. If you loaded up a picture by accident for example then the load will abort and the dreaded Guru can be avoided. *2* The text here is used in the two test menus. The first one before the colon is used in the first menu and the second one after the colon is used in the second menu that is chosen by R.Amiga 2. If you choose the first one then you will be shown the commands text and asked to enter the command .If you choose the second one you will be shown the command and asked to enter the commands text. You still need to enter this line and the colon even if you want to turn the test modes off. *3* This is the text that will be shown when you choose the second test menu this will be followed by a word/phrase from one of the commands. (See the file OLExample). *4* This is the text that will be shown when you choose the first test menu this will be followed by a word/phrase from one of the commands test. (See the file OLExample). *5* This is the mode that you want the program to be in. This is simply a two digit number. The first digit controls the test menus and the second controls the option to have the search mode working in both ways. The first number can be: 0 - Turns off the all the test menus 1 - Turns off the second test menu but leeves the first on. This means that you could show a block of text (more than one line if wanted) and get the user to give a simple one line answer. It would be pointless having the test mode work the other way because you can not enter more than one line in the string gadget. Eg. you could show a joke and get the user to try and guess the answer. 2 - Turns all the test menus on. The second number can be: 0 - Turns off the option of having the search mode work both ways. Use this if the commands text is more than 1 line long. 1 - Turns on the two way option as in the file OLExample. This means that you will have twice as many commands by using the commands text as a seperate command. *6* You can either show your own help text that will be displayed when the HELP key is pressed or you can use that which is built in. If you press return on the line STRAIGHT after the two @@ at the end then the default help text will be used. If a space or any other character except a return is found on the line directly after the two @@ then it is assumed that the users own text follows and is ended by a @. See the example above. For a full example see the file OLExample included with this package. One final comment, To write the files I normally use the QED text editor (which I have included on this disk )as you can see where you have pressed return and it is simple to use. You can however use any text editer that will save files as simple ASCII text. Showing Pictures ---------------- Showing pictures from within a file couldn`t be easier. Simply proceed the actual command with PIC: and have the text that it defines as the file name that should be loaded when the command is chosen. eg. ..... PIC:SPACE SHIP<< PictureDisk:picture1@@<< ..... You can mix text and pictures within a file. I would advise that if you use pictures you set the test modes and the both ways routine to off. You still have to enter the PIC: part in the search gadget in the main programme. 5. The Programmes History ========================= *************************************************************************** Version 1.0 Completed on 3-1-1992 First release *************************************************************************** Version 1.1 Completed on 26-1-1992 1. You can now specify the filename as a CLI parameter. 2. Uses the ARP filerequestor to get the file name from the user. 3. Uses the powerpacker library so can now load files crunched using powerpacker. 4. Converts all user input to upper-case characters. 5. You can include optional help text to go with your own files that will be shown when you press the help key. *************************************************************************** Version 1.2 Completed on 9-3-1992 1. The file requestor now filters out all .info files. 2. When a requestor is used you can respond by either pressing the related key or clicking the gadget. 3. Works on Workbench 2. 4. Added the test section so you can test yourself on various topics depending on the current file. 5. You can now print thing out to the printer. *************************************************************************** Version 1.3 Completed on 5-4-1992 1. Added the Print All option. 2. Added the About window. 3. The search mode now works both ways i.e ->command and ->answer. 4. Improved the test functions. All the above were "internal" releases. *************************************************************************** Version 1.4 Completed on 1-6-1992 (The night before my 1st GCSE!) 1. You can now have upto 65536 commands 2. You can display a picture instead of text, it is possible to have both in the same file. 3. Only opens the printer device when needed so other programmes running at the same time can still print. What next ========= In the future I hope to add a number of new features aswell as improving on those existing ones.These new features will include: 1. Improve all the existing routines! 2. Move the whole lot over to a seperate screen. (Major reprogramming of the text output routine) 3. Allow you to define multiple commands to a block of text eg. if you chose TREE or BUSH then you would see the same text for both. 4. A special editor for creating files (maybe). 5. Your Suggestions. 6. End note =========== Finally if you intend to use this program then please send me some money for my troubles say 5 (or more) pounds to my address as mentioned below. Any money sent would be greatfully appreciated (I still owe over 200 pounds on my computer and being only 15 (yes 15), I never seem to have much anyway). It would also encourage me to improve the program. Alternatively send a disk or two containing some PD or even your own programs. I will not say that this program is Shareware as that doesnt mean much to a lot of people who wouldnt pay anyway. Church Farm House, Cublington Road, Aston Abbotts, Aylesbury, Bucks, HP224NB Also thanks to everyone who helped me with ideas, testing etc.