15.01.2013 Views

Xz77gt

Xz77gt

Xz77gt

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

displayed. If we take the<br />

example of the club membership<br />

system, then the display<br />

might look something like this:<br />

Club Membership System<br />

Name -<br />

Address -<br />

Tel. no -<br />

Membership no. -<br />

Then, to define the input position<br />

for 'Name', you might<br />

move the cursor to the column<br />

next to the dash after *Name'<br />

and then store the position by<br />

pressing RETURN.<br />

After the input position has<br />

been set an overlayed menu<br />

will come down (if you've just<br />

typed the program in it's not a<br />

bug). This is where you select<br />

the type of data the field will<br />

hold, there are four types;<br />

alphabetic, numeric, digit and<br />

other. These options are on the<br />

menu plus another five, The<br />

extra ones are used to limit the<br />

values of data entered and all<br />

conform to the rules for<br />

'DIGIT' data;<br />

1 ALPHABETIC - alphabetic<br />

characters only<br />

2 NUMERIC - 0 to 9 plus+,-,/,*<br />

and point<br />

3 DIGIT - 0 to 9 only<br />

4 ANYTHING - any keyboard<br />

character<br />

5 BETWEEN between but NOT<br />

equal to two numbers<br />

6 < than<br />

7 > than<br />

8 < than or = to<br />

9 > than or = to<br />

To select datatype move the<br />

blue cursor with the up/down<br />

cursor key to the required type<br />

and press RETURN. If you<br />

select any datatype above four<br />

then you will be asked to input<br />

the relevant values.which must<br />

be conformed to, in the<br />

window at the bottom of the<br />

menu. If you have made a<br />

mistake in selecting the input<br />

position, pressing 'E' will return<br />

back to this part without updating<br />

the field pointer to the<br />

next field, so that you may redefine.<br />

The third parameter to<br />

define is the length_ After the<br />

datatype menu has disappeared,<br />

a cross cursor will<br />

appear next to the position you<br />

defined for the input, with a<br />

reverse video representation of<br />

the field number in the exact<br />

location. Holding down any<br />

key will move the cursor which<br />

will leave a trail of dots behind<br />

it, each representing one<br />

1410 GET GS:IF 6$2"R"THEN 14<br />

50<br />

1420 IF ESOPCITHEN 1410<br />

1430 60SU8 1500:IF FWE'THE<br />

N EI.IIRETURN<br />

1440 CLOSE 2:CLOSE 15:RETURN<br />

1441 REM SCRATCH OLD FILE<br />

1450 PRINT115,<br />

1 :CLOSE 2:CLOSE 15:RETURN<br />

50: 1451<br />

11530<br />

REM SAVE FILES<br />

41 1535 REM BET DATATYPE<br />

1600 GOSS 9800:PRINT<br />

1 RI6HT,SF1ORMAT OR DATA'<br />

1601 1DOWN2, GET 6$:1F 6$.1"THEN 16<br />

30<br />

1602 IF 6$0<br />

11603<br />

REM SAVE FORMAT<br />

F"THEN 1609 PRINT02,FO:PRINT#2,7<br />

11610 6FOR 06.0 1TO<br />

6<br />

:FOR H.0 TO FD<br />

:IF 8$(6,10."THEN 8$16,<br />

H1."<br />

1615 PRINT12,86(6,H1INEXT<br />

:NEXT<br />

1620 REM SAYE SCREEN LAYOUT<br />

1621 SC.49152:C0.52229<br />

:FOR I.SC TO SC+919<br />

IPRINT62,CHRSCPEEK(I)1CHR<br />

CPEEK1C0.11-SC)1i<br />

1622 NEXT:CLOSE 2:RETURN<br />

1623 t<br />

1624 REM SAVE DATA<br />

1630 PRINT12,1":PRINT42,RC<br />

1631 FOR 6=1 TO RC-1<br />

:FOR H=0 TO FD<br />

1PRINT112,AC4,6::NEXT:NEXT<br />

:CLOSE 2:RETURN<br />

1632<br />

1633 REM INPUT FILES<br />

1700 IF RF THEN 1720<br />

1701 REM SAYE FORMAT<br />

1709 INPUT02,FD:INPUT112,MI<br />

1711 IF MSOINTHEN PRINT'<br />

1DOWN3,RIGHTZI ESHATA<br />

TYPE MISMATCH I I"<br />

:WAIT 198,1:CLOSE 2:RETURN<br />

1712 HSU 9980:FOR 6.0 TO 6<br />

:FOR H.0 TO FD<br />

:INPUT12,11$(6,H::NEXT:NEXT<br />

1715 REM INPUT SCREEN LAYOUT<br />

1716 SC=491521C0.52229<br />

:FOR I.SC TO SC+919<br />

:BET112,ACIF A$<br />

01 .CHRS(0)<br />

1717 THEN POKE I,ASCCACIGET02,A$<br />

A:IF AS."THEN l AS=CHRS(0)<br />

1718 POKE CO+I-SC,ASCCAI:<br />

INEXT:RF.1:CLOSE 2:RETURN<br />

1719 REM INPUT DATA<br />

1720 INPUT112,M$<br />

18<br />

1721 IF MS(PD"THEN PRINT'<br />

EDOWN3,SPC11 ICSDI<br />

ATA TYPE MISMATCHI t"<br />

:WAIT 198,1:RC=1:CLOSE 2<br />

:RETURN<br />

1722 INPUT#2,RC:FOR 621 TO R<br />

C-11FOR H.0 TO FD<br />

:INPUT#2<br />

1:CLOSE<br />

2:RETURN<br />

1723<br />

ACH,<br />

1724<br />

61:NEXT:<br />

REM UPDATE S/R<br />

1800<br />

NEXT<br />

PRINTIELEARP:EF.0<br />

:IF RC.200 THEN SYS AT,6,<br />

12:PRINT"CSN10 MORE ROOM<br />

FOR DATA':WAIT 198,1<br />

:RETURN<br />

1810 PRINT'1HOME,C7,RVSON,<br />

SPC,WHITUF1-1SEHIEC7,<br />

SPC2,WHITE1F3-ISR1EDOEC7,<br />

SPC2,WHITE1F5-1SCEMORY<br />

(07)11SR1ECORPSTRURC1"<br />

CSPC31':SYS 52156<br />

1820 FOR 1.0 TO FD:60SUB 2000<br />

:IF P.133 THEN RETURN<br />

1825 IF A$(1,RC).<br />

11RC1.":60TO<br />

1850<br />

THEN 1826 REM REMOVE EXTRA SPACES<br />

1830 C0.01FOR 1.0 TO-1 STEP 0<br />

:CO.004.11T.:RIGHTI(A$11,<br />

RC:,C010" "11NEXTICO2C0-1<br />

1840 AS(I,RC1.LEFTICAI1I,RC1,<br />

LENCAS:1,R01-00/<br />

1850 NEXT:RC.RC4.1:60TO 1810<br />

1860 1<br />

1870 REM MAIN INPUT S/R<br />

1880 REM SET UP ZERO-PAGE<br />

LOCATIONS FOR M/C INPUT<br />

2000 Y.VAL(8$10,M<br />

1 X2VAL (8$ (10 )<br />

:SYS AT,X-3,Y-61POKE 231<br />

:POKE 1 252,VAL(6$(3,1)1<br />

2010 0POKE<br />

253,VAL(LEFTS:13114,<br />

1/0))<br />

2011 REM PRINT CURSOR AND<br />

SET INPUT POSITION<br />

2020 PRINT"1CO,UPP<br />

:SYS AT,X-2,Y-6:It.""<br />

:FOR T.0 TO 1 STEP 0<br />

:SYS 51885:P=PEEK(254)<br />

IF EF THEN 2035<br />

2021 IF P2135 THEN 60SU8 9800<br />

:GOSH 2400:NEXT<br />

2025 IF P.I34 AND I THEN I$.<br />

1$.0 ":60SUB 2420:T=1:NEXT<br />

:60TO 2000<br />

2030 IF P.133 THEN T.IINEXT<br />

:RETURN<br />

2031 REM DELETE CHARS<br />

2035 IF P.20 THEN IS.LEFTSCI<br />

$,PEEK(25111:NEXT<br />

character. This gives a visual<br />

representation of the fi eld<br />

length, but on the bottom line<br />

is a count of the number of<br />

characters. The cursor may be<br />

moved until either a length of<br />

255 is reached, or another<br />

character is encountered in<br />

front of the cursor. RETURN<br />

sets the length and DEL allows<br />

you to move back the cursor.<br />

The final part of this section<br />

of the program is typing in the<br />

field name. You will be<br />

prompted to do this on the<br />

bottom line after defining the<br />

length. All the processes discussed<br />

then have to be<br />

repeated for each field. As in<br />

the previous section for<br />

defining the screen layout, in<br />

this section the function keys<br />

have certain uses. They are; Fl<br />

(Exit) returns back to the<br />

beginning of the program; F3<br />

(Clear) homes the cursor and<br />

resets the field count to one; F5<br />

(Back) allows you to go back<br />

and redefine the previous field<br />

if you made a mistake.<br />

When you have finished<br />

defining the database the<br />

program will ask if you wish to<br />

save the data to tape or disk. If<br />

you choose tape remember to<br />

take note of the tape count.<br />

You must also wind the tape<br />

back to the position of the main<br />

program so that it can be autorun<br />

(of course on disk this is<br />

automatic).<br />

Management or Main<br />

Program<br />

When the main program has<br />

auto-run, press any key to exit<br />

the intro screen so that you are<br />

then presented with the main<br />

menu. In the top right of the<br />

screen is printed the number of<br />

empty records remaining i.e.<br />

how many more records can be<br />

input. Laid out below this are<br />

the 10 main functions of the<br />

management program which<br />

can be accessed by pressing<br />

zero to nine, When the<br />

program is fi rst run only<br />

options one and eight can be<br />

selected since no data is<br />

present and also there is no<br />

'format' where it can be held.<br />

The formatting can be done<br />

using option eight, which will<br />

be described later, or option<br />

one can be used to lead in a<br />

format or any data.<br />

To describe how to use the<br />

program ril go through each<br />

option in turn:<br />

1 — Press this yields yet<br />

another menu with five more<br />

options all of which are really

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

Saved successfully!

Ooh no, something went wrong!