12.07.2015 Views

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

20 Killing TimeSometimes, it may seem to you as if the computerwill never get to the result of a job. You understand theprocessing delay but your non-computer friends may not.They could be confused by the wait and think the computeris "broken."To keep their minds off the slowness, give themsomething to look at while the computer is "thinking."The added, extra lines, numbered 60 and 70,take up more processing time but make for less confusion.Computing may take a bit longer but your fun will beincreased.If you delete lines 60-.70 you'll see how the programruns faster but the blank screen is confusing.Program Listing10 LET X=j620 PRINT •GIVE ME A NUMBER"30 INPUT N40 FOR L=l TO N50 LET X=X+L60 CLS70 PRINT •I AM THINKING"80 NEXT L90 CLS100 PRINT •I HAVE THE ANSWER"110 PRINT •THE TOTAL OF ALL NUMBERS"120 PRINT •FROM 1 TO ";N;• IS •;x130 PRINT140 GOTO 1021 Word-Error TrappingThe same kind of error trapping is available forstrings. Suppose the program, as in this exa.mple, asks at37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!