-------------------------------------------------------------------------------- Selection of BASIC programs by Keith M. Simons (C) 1989 K.M. Simons, Cheadle Hulme, Cheadle, Cheshire. SK8 5HP Distributed by PCW-World, 7 Deeley Close, Cradley Heath, Warley. B64 7NF -------------------------------------------------------------------------------- This is the manual which goes with the above disc full of programs. You will find full instructions of how to use the programs, as well as other helpful information. The selection of programs includes a number of educational games, some business- type programs (which I use myself in the office), a utility to help you to learn to touch-type, a "trivia" game, a simulation of a journey through our solar system... and a few other programs too. All programs may be copied freely for non-profit making purposes only, but may not be distributed in any modified or altered form and may not be included in any commercial program or for commercial reasons. The routines called "NEWINPUT.BAS" and "CHOICE.BAS" may be altered for inclusion in any non-profit making programs provided the copyright notice is retained. The "trivia" game, Q&A.BAS only may be altered freely, and questions for it may be added or released as shareware. If distributing this selection, you are recommended not to rename any of the files and to include all the files supplied and mentioned in this documentation. All programs are supplied on condition that the user takes full responsibility for their use and for any damage they might cause through failure to operate correctly or any other matter. They have however all been tested, and problems of this nature are not envisaged. Copyright is retained in all programs by the author, Keith M. Simons. -------------------------------------------------------------------------------- CONTENTS -------------------------------------------------------------------------------- Part 1 - Getting going 1.1 How to begin... Where to begin... Will I ever end? 1.2 Help for the lost! 1.3 CHOICE.BAS - easy to use menus to run all the programs 1.4 Using the programs on a PCW9512 Part 2 - Business Programs 2.1 LABELS.BAS - the label printer that thinks it's a database 2.2 SEARCH.BAS - text editor and model specimen of spaggetti code 2.3 NUMBERS.BAS - calculator featuring big numbers 2.4 CALC.BAS - calculator featuring logs,sines,cosines and tangents 2.5 WORDS.BAS - a word counter disguised as a style analysis program 2.6 TYPER.BAS - a PCW that thinks it's a line-by-line typewriter 2.7 KEYBOARD.BAS - a PCW that thinks it's a line-by line typewriter and a typing tutor at the same time! 2.8 DIARY.BAS - not a diary 2.9 CALENDAR.BAS - prints calendars 2.10 ACCOUNT.BAS - how much is in that Nat West account? 2.11 CONV.BAS - imperial to decimal and vica versa Part 3 - Fun and Games 3.1 FISH-NET.BAS - can you make a million pounds in this fishy game without getting netted?! 3.2 SPEED.BAS - drivers beware! How fast are your reactions? 3.3 CLOCK.BAS - beat the Krypton Factor at their own game! 3.4 CLOCKABC.BAS - version of CLOCK.BAS with letters and not numbers 3.5 PHONE.BAS - mental exercise and more besides 3.6 Q&A.BAS - the much awaited P.D. trivia quiz 3.7 SNOW.BAS - I'm dreaming of a white Christmas 3.8 SIMULN.BAS - journey of a lifetime. Escape the sun at five times the speed of light 3.9 ANIMATE.BAS - the world is not an oyster Part 4 - Programmers Paradise 4.1 JETSAM.BAS - for BASIC programmers who want fast filing 4.2 ASCIICOM.BAS - converts ASCII files into .COM program files 4.3 COPY.BAS - the easy way to copy files. Copy without PIP! 4.4 NEWINPUT.BAS - there's a better way to INPUT 4.5 SCREEN.BAS - makes pretty screens that can be TYPEd -------------------------------------------------------------------------------- Part 1 - Beginners Start Here -------------------------------------------------------------------------------- 1.1 Welcome. This is a selection of programs from my personal collection, written over a period of one and a half years. Some are provided just for amusement, others are very serious programs, which I use almost daily at work. How to begin? Well, to get this far you've probably gleaned enough to start using the programs. You start the computer by putting in the CP/M disc. Then, at the A> prompt, you type the word BASIC followed by a single press of the [RETURN] key. After you see the copyright notice, take out your CP/M disc and put in this disc or a copy of it. Type the word RESET again followed by [RETURN]. You can now see what programs are in the disc by typing DIR followed by - you guessed it - [RETURN]. You can try any of the programs whose names end in the letters .BAS by typing RUN "FILENAME" then [RETURN], substituting the word FILENAME above for whatever the part of the program name before the full stop is. If you're new to BASIC, though, you probably will prefer to use the "menus", when you make decisions by going down the lists of options with the up and down arrow keys and pressing [ENTER] when you've highlighted what you want - type at this stage RUN "CHOICE" then [RETURN]. When you've finished using BASIC you type SYSTEM [RETURN]. The following programs should be on your disc (and maybe a few more). If not, then you don't have the full batch of programs which should be included. ACCOUNT.BAS 3K ANIMATE.BAS 3K ASCIICOM.BAS 2K CALC.BAS 2K CALENDAR.BAS 2K CHOICE.BAS 4K CLOCK.BAS 3K CLOCKABC.BAS 3K CONV.BAS 4K COPY.BAS 2K D.COM 1K DIARY.BAS 1K FISH-NET.BAS 4K HELP1.SCR 1K HELP2.COM 2K HELP2.SCR 2K JETSAM.BAS 5K KEYBOARD.BAS 5K LABELS.BAS 7K LABELS.DAT 2K LABELS.INX 1K MANUAL. 23K NEWINPUT.BAS 2K NUMBERS.BAS 4K PHONE.BAS 3K Q&A.BAS 14K RETURN.BAS 1K SAMPLE.ACC 1K SCREEN.BAS 4K SEARCH.BAS 11K SIMULN. 3K SIMULN.BAS 3K SNOW.BAS 1K SPEED.BAS 2K START.COM 1K TYPER.BAS 2K WORDS.BAS 8K 37 Files 38 Extents 0 System files 142K Listed 142K Used 31K Free When typing numbers the programs may sometimes suggest that you hold down [ALT] and press [RELAY] - this means that you can use the small numbers on the arrow keys as a numeric keypad. Do the same thing to make them act like arrow keys again! (You can do this at any time - even using LOCOSCRIPT. [ALT] and [ENTER] will capitalise all A..Z letters). 1.2 You may decide that having started your program you don't want to run it. Press STOP, at which point you may get an Ok prompt, at which you can tell BASIC to RUN "CHOICE" or another program. Some other programs do not have this feature for various reasons. Select to finish using, or keep on with the program if necessary. When you are typing information into a program, sometimes you have to press [RETURN] or [ENTER] (they are interchangable on all these programs) after typing your information. Sometimes you do not. If you're not sure, then try waiting and if nothing still happens then press [RETURN]. If you find yourself totally stuck, then you are best advised to try to remove the disc and turn off. Don't do this unless you've tried everything, though! Feel free to experiment with these programs. Please note that it is not generally a good idea to use these programs with Drive M: full of files or using a disc which is write-protected (see your PCW manual on how to remove this protection). You may wish to make a copy of this disc before using, and use DISCKIT or PIP (see your PCW manual again), or NSWP or BOP if you have these programs. To finish using BASIC without using the option in CHOICE.BAS (see below), try typing: SYSTEM and press [RETURN]. 1.3 CHOICE.BAS. This is a system which enables a non-programmer to use the programs. You are welcome to alter this for your own non-commercial programs only. To use it, you RUN "CHOICE" as is described above. All programs in this suite are linked in with this system, and you are supplied with a list of them (this list is called "the main menu"). You select the option you want using the up and down arrows, until the one you want to use is shown as green on black. Press [RETURN] or [ENTER] (some other keys will do the same) and the computer will read in from this disc the program you want and RUN it. After the program has finished, the following message will appear on the screen: [Press [STOP] to stop or any other key to return to main menu] (The message may appear in a very strange place on the screen... it may even be split between two lines and you may well have to look for it!). You will not get this message if you have not been using CHOICE.BAS. If at this stage you want to inspect the program, the disc or simply not go back to the main menu, just press [STOP] now. Otherwise press any other key. This program, as well as a few others, uses the M: drive and for this reason you are recommended to leave some empty space in the M: drive. 1.4 So you want to use these programs on a 9512! Most of them will probably work fine. You will have to find out what you can and can't do in SEARCH.BAS... you obviously can't type italics. These programs were however written on an 8256 so (just like anyone else)... you may have to experiment. Actually, the main difference is that anything I say will be green on the screen will in fact be white, and second to this you may find printing rather strange. -------------------------------------------------------------------------------- Part 2 - Serious and Useful Programs for Business -------------------------------------------------------------------------------- 2.1 LABELS.BAS. Many label printing programs are available in the Public Domain. This one adds a new dimension however. It comprises a database which uses JETSAM commands, enabling speed of control. Each label is stored alphabetically under the name you are asked for when typing it in for the first time. At the beginning of the program you are asked for the length of your labels. This is the measurement from the top of one label to the top of the next, in 6ths of an inch. My labels are one and a half inches long, so I input 9 then press [RETURN]. The rest of the program is fairly obvious from the help display. You use the left cursor key to see entries earlier in the alphabet, the right cursor key to see entries later on in the alphabet. You ought to use continuous labels and the sprocket feed provided for the purpose on the PCW 8256/8512. The program will only print on one label across. Position the labels with the printer head where you want to start printing on the first label. When you are editing a new or existing label, you can use all four cursor arrow keys, the delete keys and [RETURN] to get to the start of the next line. When you've finished, press [EXIT]. If you were editing a new label you will then be asked under what name it should be alphabetically stored. Some more help can be found running the program... your labels will be stored after the HELP pages in alphabetical order (well, actually ASCII order if you understand the abbreviation). Please note that you may have to be registered under the Data Protection Act to use this program for some purposes (e.g. if you are storing personal information for the purposes of a mailing list). Please satisfy yourself on this. 2.2 SEARCH.BAS. This program provides a full screen text editor which you can use within BASIC. Unlike RPED.BAS supplied with the PCW there is no file length limit (it uses the M: Drive for storage of data). It is however quite a slow program. I use it for typing forms (believe it or not, Search Forms - hence the name!)... with a bit of practise you can persuade this program to type in the boxes on forms - accurate to 1/72nd of an inch. When you enter the program you are given a list of options. Just type the number you want. After printing, you are returned to editing the file. Press [EXIT] at this stage if you don't want to edit it further. You'll find full details on the screen as you run it. To operate the various printer controls (bold, italic etc.) in the green panel on the edit screen, you just type them as ordinary characters into your document. In fact, the only time they are not treated as ordinary characters is when you come to print them out. The section symbol is next to the : on an 8256/8512. 2.3 NUMBERS.BAS. The ultimate business calculator. Accounts without eyestrain. Used regularly. Full details as you run it. 2.4 CALC.BAS. Scientific calculator. Full details as you run it. Programmers will find the code of especial interest. This is a program which actually writes itself as it runs! (How's that for artificial intelligence!) 2.5 WORDS.BAS. If you think word counters count words, try this one! Full details as you run it. It requires you to use an ASCII file made from LOCOSCRIPT as a simple text file, first. Put your ASCII file in group 0 of the disc, and then... begin! 2.6 TYPER.BAS. For those who lament the passing of the typewriter. Details as you run it. You type [EXIT] when you've finished. 2.7 KEYBOARD.BAS. Finished today! Just like TYPER.BAS above, but also acts as a tutor to help you to learn to touch type. No need to watch the keyboard as you type. 2.8 DIARY.BAS. This program is designed to work on ruled paper for ring-bound folders (not A4 size - the size below). Given the number of days in the month, the name of the month and also what week-day is the first day in the month, it will print out a line-to-a-day diary for the month. Now, you won't be able to use this if you haven't the correct paper size. The first line is drawn 14/16ths of an inch from the top of the page. There's 37 lines drawn on the page, the paper is just over 8" wide and 10" deep (is that quarto?). The bottom line is drawn 5/16ths of an inch from the bottom of the page. The margin is a little over 1" from the side of the page. 2.9 CALENDAR.BAS. This program is intended to be used on the same paper as DIARY.BAS, but it doesn't really matter for this one. Use plain A4 or Quarto instead. When you run it, it will ask you for the year, and the day of the week it begins with. (You type the number beside the appropriate day in the list given then press [RETURN]). The computer will print out a properly formated calender for the year given. 2.10 ACCOUNT.BAS. This program keeps track of your account balance in any number of cheque (or other) accounts. First of all you are requested to type in the name of the file you want to use. This must be less than 8 letters long and must not contain only letters and numbers - it must not contain a fullstop. Then press [RETURN]. The program will add to this the letters .ACC which end all accounts files names. If your file exists already, you will be shown the balance in the account. If not, you will first be asked to type in the account name (can be any length) and also the current balance. The balance is then shown with the three main options in the program. Type in the number beside the one you want. Use "cheques" for any withdrawals, "payments in/credits" for any payments in. If you select either of these you will be requested to type in just the amounts of the various payments, each followed by [RETURN]. When you have finished entering them, type in simply [RETURN] in place of the amount. When you select finish using if you have made any alterations you are required to type in the last cheque no. you have used (followed by [RETURN]) and then the date of using the program, then [RETURN]. These last two entries are for your information only as they will be shown to you the next time you use the program to prevent you from entering a payment etc. twice. 2.11 CONV.BAS. A program to convert measurements. This program has no end of "pull down menus". To operate them you must use the up and down cursor keys to select the item you require from the list, and then press [ENTER] to select it - just like you do in Locoscript. Or CHOICE.BAS. The program first offers you a selection of the type of measurement you would like to convert. You are then invited to select the measurement to convert from, then to convert into. On the right hand side of the screen you now type in the amount. When you press [ENTER] this is converted for you. Press [ENTER] again to continue. Select "finish using" at this stage if you've finished. -------------------------------------------------------------------------------- Part 3 - For Your Education and Amusement -------------------------------------------------------------------------------- 3.1 FISH-NET.BAS. Just follow the instructions given. When asked to buy, sell or travel, type the first letter of the one you want only. The same to choose fish or nets. When asked to input amounts, type in the number of fish or nets as appropriate (not the cost) and then press [RETURN] or [ENTER]. Helps mental arithmatic. 3.2 SPEED.BAS. How fast are your reactions? Answers given accurate to approx. one five hundredth of a second. Full details given when you play. 3.3 CLOCK.BAS. A fun exercise in remembering over a short length of time. Aimed to assist you with your ability to remember. 3.4 CLOCKABC.BAS. A variation of CLOCK.BAS. (see 3.3) 3.5 PHONE.BAS. Another memory game. Will help you remember all sorts of facts and figures. Here you learn phone numbers... against the clock. Your time to learn decreases as you play! 3.6 Q&A.BAS. Yes, another memory game. This one is the one you've been waiting for. A free trivia game. Yes, your knowledge of all sorts of facts and figures is put to the test. There's 100 questions on the disc, but they don't repeat unless they have to. To play the game. When you're asked for your name, type it in and then press [RETURN]. You will be asked to press any key. Then you are asked for the time you want to answer the questions. Start with, say 10 or 15 seconds. You can decrease to as little as one second. On the top left of the display there is a noughts and crosses board, each square being numbered. Your aim (as in noughts and crosses) is to get three in a row, or at least to stop your opponent (the computer) getting three in a row. Select a square by pressing the appropriate number. You now have your desired length of time to answer the question. A timer will tick away just below the noughts and crosses board. To answer just press the appropriate number... 1,2 or 3. If you don't answer within the time allowed or you get the answer wrong you will be told the correct answer and the square you wanted will go black. If you got it right the square will go green. You will then be asked to select your next square if there is another to choose. If there are no squares left or you or the computer have won, you will be invited to play again. Press y if you want to play again, n if you don't. Finally, a note for programmers... if you want, add some questions. You may have to alter the program slightly if there are considerable numbers more. At the beginning of the DATA statements you will find the number of questions, less 1, and this will need altering. The actual questions comprise DATA statements. The first three items of data (seperated by commas) are the question, the next three the multiple choice answers and the final item is the correct answer. You might like to release new collections of questions into the public domain or as shareware. 3.7 SNOW.BAS. sNOw COMMENT! Press any key to stop! 3.8 SIMULN.BAS. Take about three minutes to explore the vastness of the solar system. Facinating. 3.9 ANIMATE.BAS. Various countries from around the world are compared with the U.K. in a graphical form. This program never ends. When running, press [STOP] once to stop the program (but it doesn't stop immediately... just press [STOP] then wait), or press any other key to toggle the sound on or off. Designed for use at exhibitions... just leave the PCW running... or for educational/general interest purposes. -------------------------------------------------------------------------------- Part 4 - Programs for Programmers to Program Programs(!) -------------------------------------------------------------------------------- 4.1 JETSAM.BAS. Designed to supplement the BASIC manual in teaching you how to use the JETSAM commands in MALLARD BASIC. 4.2 ASCIICOM.BAS. Full instructions when you run it. Yes, this is the only program I have ever seen which creates .COM program files (of a sort) and itself is in BASIC! Use a Locoscript Page Image file (Make Ascii File) or one produced by RPED.BAS supplied with the PCW or even an .SCR file made by SCREEN.BAS. Does not work if file contains a $ symbol. 4.3 COPY.BAS. The inexperienced user will have no difficulty using this. It will copy any file of less than 16K in length from one drive to another. Just follow the on-screen instructions. 4.4 NEWINPUT.BAS. Well worth putting in any BASIC programs involving typing in any amount of text. 4.5 SCREEN.BAS. Creates ascii-type files which will look fancy as they are TYPEd onto the screen. Be warned that this program is user-unfriendly. When you start using it your screen will go blank! Move your cursor with the arrow keys to anywhere on the screen. You can type on this position, and edit with cursor and delete keys. When you've finished, press ENTER. The cursor will return to the first letter of what you've just typed. If you keep on pressing [ENTER] you will highlight the line, underline it, put it in various fancy boxes etc. and eventually be returned back to editing the line. When you're happy with how it looks just move the cursor keys to another position and continue. To save it, press [EXIT] and type a filename of up to 8 letters long. The program will add to the name the suffix .SCR. The files are compatible with the ASCIICOM.BAS .COM file maker included on this disc. The end of the manual is here. By Keith M. Simons. Copyright 1989. All trademarks acknowledged.