Display Formatting - AMSTRAD CPC464 User Manual

Cpc464 colour personal computer 64k
Hide thumbs Also See for CPC464:
Table of Contents

Advertisement

5 CLS
6 I N P U T " W h a t i s y o u r n a m e " ; N A M E $
1 0 I N P U T " W H A T I S Y O U R S A L A R Y " ; S A L A R Y
2 0 I F S A L A R Y < 1 0 0 0 0 T H E N G O T 0 3 0 ELSE 40
3 0 P R I N T " A S K F O R A P A Y R I S E " : E N D
4 0 P R I N T " A S K F O R A B I G G E R C A R "
5 0 I F S A L A R Y > 3 0 0 0 0 T H E N P R I N T
" a n d g e t a g o o d a c c o u n t ant"
6 0 I F S A L A R Y > 2 5 0 0 0
" . . . . a n d l e n d m e a f i v e r " ; N A M E $
6 1 D A I L Y . R A T E = S A L A R Y / 3 6 5 :
P R I N T " t h a t ' s " ; D A I L Y . R A T E ; " a d a y "
6 2 I N T E G E R . R A T E % = D A I L Y . R A T E : P R I N T
" o r " ; I N T E G E R . R A T E % ; " i f y o u a r e n o t
w o r r i e d a b o u t t h e o d d p e n c e "
7 0 F O R n = 1 t o 50 0 0 : N E X T n : G O T O 5
run
And run again.
Note that you must remember to continue to use the type marker % since it is possible to have a real
variable with the same name as the integer variable, the difference being identified by the % symbol.
Also see how the computer display ' wraps' lines that are too long to fit on a single line (it happens in
all three modes).
Use
for writing long programs, since it' s much easier to read programs that are not for ever
MODE 2
running over the ends of the lines.
To get to MODE 2,type
MODE 2
And to produce black on white display that is easier to read on the CTM640, enter the following
three direct commands:
INK 1,0
I N K 0 , 1 3
B O R D E R 1 3
Now
again.
LIST

4.8 Display formatting

Part of the evolution of your program is the process of tidying it up from time to time. The first thing
we can do is renumber all the lines to multiples of 10 by using the RENUM command. At the Re
prompt, type:
RENUM
And then LIST again:
T H E N P R I N T
ady

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents