SECTION A - PRIMER FILE PRIMER.A SCREEN DISPLAY ************** It is possible to write a program where nothing appears on the screen, but this is not very productive. In most programs you will want to see the results of your labours shown on the screen and in a pleasing and easy to understand format. This is your chance to use your artistic skills to achieve a good layout. Everybody has their own idea on this. I prefer a fairly plain layout, and this probably reflects my engineering background. Others like to surround each heading in a neat box, and use plenty of stars and other symbols to decorate the screen. In this section we find out how to write to the screen and begin to see how to position text where we wish it to go. PRINT This command is used to write to the screen. For example, ===== PRINT "hello " is a single line in a program which will print the word hello on the screen. The computer recognises the word PRINT as a command and will print numbers, letters or symbols which appear after it provided that they are properly presented. For strings of letters or other symbols this means that they must be enclosed in double quotes as shown. If treated in the same way, numbers will print exactly as typed and BASIC will regard them simply as a string like any other. Numbers will print without quotes and in this case can be used to perform arithmetic. This is an important point; for example PRINT " 6+4 " will print 6+4 on the screen, whereas PRINT 6+4 will print 10, the answer to the sum. In the listing which follows we shall see how to use this to write complete sums. A space is as much a character to your computer as any other, and we can make use of this to improve layout, perhaps putting spaces between words e.g PRINT "Monday Tuesday Wednesday" when it will print exactly as shown including the spaces. One character that will not print between double quotes is the double quote , which is hardly surprising, as the computer sees it as a command in itself. There is a way of overcoming this as we shall see later, but for the present a simple solution is to use single quotes, as PRINT "The boy said 'Hello' and walked on " Finally , PRINT used on it's own will print a complete blank line and one often uses lines such as 10 PRINT:PRINT "Hello" where the first PRINT simply forms a blank line to improve layout. Note the colon (:) between the PRINT commands, necessary to separate individual commands. Punctuation marks play a big part in programming! PRINT TAB(10) This command is used to start printing part-way ============= across the screen instead of from the side of the screen, the figure in brackets representing the distance from the edge in columns. In normal useage the PCW screen is 90 columns across and TAB(10) tells the computer to start printing at column 10. This is useful when printing central headings, or indenting etc., but can fail if the TAB number is too large for the job in hand. It is best used by trial and error, later guided by experience. ZONE Zone printing is used to equally space numbers, words etc. ==== across the screen.If no zone command is specified the default setting is to print 6 columns across. For example, if we print : 30 PRINT 23,34,21,7,90,56 (note the commas) then when run these figures would be printed equally spaced across the screen. It is easy to see that several lines like this would print columns of figures, so that a table could be constructed. Words can be treated in the same way, so headings could be added to each column. But suppose we didn't want 6 columns but only 3 ?. The standard setting for the PCW screen has 90 columns across and the zone default setting is ZONE(15) so 90 divided by 15 = 6, , the default number of columns. If we use the command ZONE(30) then 3 columns will be printed ; 90 divided by 30 = 3 . The same principle applies for all numbers. Some interesting results can be obtained by experiment. Once the ZONE command has been made it will stay in force until a new ZONE setting is made or until a new program is loaded, when it reverts to the default setting. The listing which follows illustrates the uses of PRINT , PRINT TAB( ) and ZONE. Please look for and follow the instructions for running the program and don't be afraid to experiment, as this will speed up the learning process as well as adding a great deal of interest. If you're not sure what to do reread the INTRO section on editing. END OF FILE PRIMER.A If you're not sure what to do reread the INTRO section on editing. END O