Jump to content

Page:NBS Technical Note 11176 (1983) (IAutilityprogramsf1176dick).djvu/26

From Wikisource
This page has been proofread, but needs to be validated.

Listing 1. Candy Apple program.

10  TEXT : HOME : HTAB (14): VTAB (10): PRINT "CANDY APPLE": REM  A HERSHE
     Y CHARACTER FILEHANDLER FOR THE APPLE II
20  PRINT  CHR$ (4);"BRUN LOMEM:": &  LOMEM: 24576:REM     RELOCATES A/S T
     O START AT $6000 (ABOVE HGR 1 & 2)
30  BELL$ = CHR$ (7)
40   HOME : HGR : HGR2
50  D$ = CHRS (4): DIM X$(150): REM  SAVE SPACE FOR 5 FONTS OF 32 CHARACTE
      RS
60  POKE 768,01: POKE 769,00: POKE 770,04: POKE 771,00: POKE 772,58: POKE
     773;36: POKE 774,45: POKE 775,54: POKE 776,07: POKE 777,0: POKE 232,0
     0: POKE 233,03: REM  LOAD SHAPE TABLE FOR HIRES CURSOR
70  TEXT : HOME : HTAB (14): VTAB (10): PRINT "CANDY APPLE":  REM START AN
     D INIT. DISK DRIVES
80   PRINT BELL$: INPUT "READ FROM DISK DRIVE:";DI: IF DI < 1 OR DI > 2 THEN
      80
90   PRINT BELL$: INPUT "WRITE TO DISK DRIVE:";DO: IF DO < 1 OR DO > 2 THEN
      90
100   HOME : REM MAIN MENU
110   PRINT : PRINT "DO YOU WISH TO....": PRINT : PRINT  TAB( 10);"1.CREATE 
       A NEW FONT": PRINT : PRINT  TAB( 10);"2.MODIFY AN EXISTING FONT": PRINT 
      : PRINT  TAB( 10);"3.EDIT FONT CHARACTERS"
120   PRINT : PRINT  TAB( 10):"4.DISPLAY (TRANSFER) A FONT": PRINT : PRINT
       TAB( 10):"5.ASSIGN DISK DRIVES": PRINT : PRINT  TAB( 10)+"5.CATALOG
      OF DISK :";DI: PRINT : PRINT  TAB( 10):"7.QUIT": PRINT BELL$: INPUT "
      WHICH?":C
130   IF C < 1 OR C > 7 THEN 100
140   IF C > 4 THEN 180
150   PRINT : PRINT BELL$;: IF N$ <  > "" THEN VTAB (23): PRINT "RETURN US
      ES FILENAME: ";O$
160   VTAB (21): INPUT "FILENAME: ";N$: IF LEN (N$) = 0 THEN N$ = O$
165  O$ = NS
170   HOME
180   ON C GOTO 999,3000,5000,4000,70,9000,10000
999   HGR2 : TEXT
1000   PRINT "* ROUTINE TO CREATE AN HERSHEY FILE     NAME: ":N$
1010   PRINT BELL$: PRINT "INPUT HERSHEY COOR.<H> OR USE CURSOR    CONTROL<
      C>?";: GET A$: PRINT A$: IF A$ <  > "H" AND A$ <  > "C" THEN 1010
1020  EF = 0: IF A$ = "C" THEN EF = 1
1030   IF EF THEN 1090
1040   PRINT BELL$: PRINT "* INPUT THE HERSHEY COORDINATE PAIRS ON THE PROM
      PTING BELL "
1050   PRINT : PRINT "* THE CHARACTER READ ROUTINE ASSUMES    THAT THE PEN
      STARTS IN THE UP POSITION. TO SIGNAL A PEN CHANGE, INSERT A SPACE  BE
      TWEEN THE COORDINATE PAIRS."
1060   PRINT : PRINT * TO SIGNAL THE END OF THE CHARACTER    INSERT THE DE
      LIMITER / "
1070   PRINT : PRINT "* TO SIGNAL THE END OF THE FILE ENTER   THE EOF CHARA
     CTER <E>."
1080   PRINT : PRINT "* THE FIRST COORDINATE PAIR INDICATES   THE WIDTH OF
     THE CHARACTER...TO ENTER    A NULL CHARACTER ENTER 0,0"
1090   PRINT BELL$: PRINT "READY? ";: GET Q$: PRINT Q$: IF Q" <  > "Y" THEN
       HOME : GOTO 1000
1100  HOME : IF FI THEN 1120
1110  IF C THEN L = 0
1120  GOSUB 8000: PRINT TAB( 10);"FILENAME:";N$:A$ = ""
1130  PRINT : PRINT  TAB( 10);"CHARACTER STRING NO: ":L:X$(L) = "":Z =   FRE
     (0):PF = 0
1140  IF L = 160 THEN X$ = "E": GOTO 1220

17