17.01.2013 Views

AmstradCPC6128-hypertext-en-Sinewalker

AmstradCPC6128-hypertext-en-Sinewalker

AmstradCPC6128-hypertext-en-Sinewalker

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The <strong>en</strong>d of the beginning ....<br />

So now we have writt<strong>en</strong> a program which fulfils the requirem<strong>en</strong>ts that we set out to<br />

achieve wh<strong>en</strong> we decided 'what the program has to do'. All that remains now, is to<br />

improve the way that 'the results are pres<strong>en</strong>ted' on the scre<strong>en</strong>.<br />

The beginning of the <strong>en</strong>d ....<br />

Let's add some instructions to tidy up the pres<strong>en</strong>tation of the program:<br />

34 MODE 1<br />

This establishes the scre<strong>en</strong> mode, and clears the scre<strong>en</strong> at the start of the program.<br />

Now add:<br />

36 WINDOW #1,13,30,10,14<br />

Don't be put off by this seemingly complicated instruction. What we're doing here is<br />

creating a small window on the scre<strong>en</strong> to put the m<strong>en</strong>u into. After the word WIN D 0 W,<br />

we first specify which stream number this window is for, remember we can use 8<br />

scre<strong>en</strong> streams from # 0 to # 7. Now bearing in mind that all items printed on the<br />

scre<strong>en</strong> use stream # 0 unless otherwise instructed, we won't use stream # 0 for our<br />

little window, otherwise everything that the program prints will be s<strong>en</strong>t to it. Instead<br />

we'll specify another stream betwe<strong>en</strong> # 1 and # 7, and as you can see, we've chos<strong>en</strong><br />

# 1. The four numbers that follow # 1, tell the computer what size the WIN D 0 W<br />

should be, and it couldn't be easier; the numbers specify the left, right, top, and<br />

bottom edges of the window, and refer to text column and row numbers (the same as<br />

those used in the L 0 CAT E command). So in our example, after specifying that it's<br />

stream # 1 we're using, we say that the left edge of the window starts at column 13,<br />

the right edge <strong>en</strong>ds at column 30, the top edge starts at row 1 0, and the bottom edge<br />

<strong>en</strong>ds at row 14.<br />

Now to make all our m<strong>en</strong>u options print in stream (W I N D 0 W) # 1 , we'll have to edit<br />

lines 40 to 80 as follows:<br />

40, PRINT # 1 , " 1 . <strong>en</strong>ter info"<br />

50 PRINT #1,"2. Lis t info"<br />

60 PRINT #1,"3. search"<br />

70 PRINT #1,"4. save info"<br />

80 PRINT #1,"5. Load info"<br />

Let's now add:<br />

85 LOCATE 7,25<br />

Beyond Foundations Chapter 2 Page 11

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

Saved successfully!

Ooh no, something went wrong!