Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF (EN)

57 10 PRINT formatting and cursor control This chapter describes the PRINT statement which is used to put text on the screen or to a printer. It assumes that you understand that a variable (such as X) can be used to hold a number and that a string variable (such as A$) can be used to hold a line of text. The following program will help to illustrate some of the ideas. Press BREAK and then type in the following program. 10 X=8 20 A$="HELLO" 30 PRINT X, X, X When this is RUN it produces this:

>RUN 8 8 8 This shows that commas separating items in the print list (the print list is the list of things to be printed – X,X,X in this case) will force items to be printed in columns or “fields” ten characters wide. Numbers are printed at the right hand side of each column whereas words are printed on the left hand side. You can see the difference if we add some lines to the program. 10 X=8 20 A$="HELLO" 30 PRINT X,X/2,X/4 40 PRINTA$,A$,A$ >RUN 8 4 2 HELLO HELLO HELLO Field widths in different screen modes As we said above, the width of each ‘field’ is automatically set to ten characters when the computer is switched on.

Since the computer can operate in different screen modes, displaying 20, 40 or 80 characters to the line, clearly the number of fields which can be displayed on