home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib42b.dsk
/
INPUT.DEMO.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
2KB
|
84 lines
10 REM ********************
20 REM * AIU DEMO *
30 REM * BY H.B. CLYDE, JR. *
40 REM * *
50 REM * COPYRIGHT (C) 1992 *
60 REM * MINDCRAFT PUBL. CO.*
70 REM ********************
80 REM **NOTE: BLOAD AIU BEFORE RUNNING THIS PROGRAM **
90 REM
100 IN$ = " ": REM MUST BE FIRST VARIABLE DEFINED
110 REM
120 REM SET UP ADDRESSES IN
130 REM VARIABLES FOR EASY
140 REM REFERENCING
150 PFG = 254: REM PROMPT FLAG
160 MXL = 255: REM MAX. LENGTH
170 AIU = 768: REM THE ROUTINE
180 REM
190 REM ML%( ) CONTAINS NO. OF
200 REM CHARACTERS ALLOWED FOR
210 REM EACH OF THE 3 ENTRIES
220 ML%(1) = 20: REM NAME-20
230 ML%(2) = 30: REM ADDRESS-30
240 ML%(3) = 12: REM PHONE-12
250 REM
260 REM DETERMINE WHETHER OR
270 REM NOT TO PROMPT INPUT
280 REM WITH UNDERLINES
290 HOME
300 VTAB 10: HTAB 7: PRINT "DO YOU WANT UNDERLINE PROMPTS?";
310 GET P$
320 IF P$ < >"Y" AND P$ < >"y" AND P$ < >"N" AND P$ < >"n" THEN 310
330 IF P$ = "Y" OR P$ = "y" THEN POKE PFG,1
340 IF P$ = "N" OR P$ = "n" THEN POKE PFG,0
350 REM
360 REM CLEAR SCREEN, PRINT
370 REM FIELD NAMES AND RESET
380 REM THE CUSOR TO VTAB 1
390 HOME
400 PRINT "NAME....:
410 PRINT "ADDRESS.:
420 PRINT "PHONE...:
430 VTAB 6: HTAB 10: PRINT "<ESC> RESTARTS LINE"
440 VTAB 1
450 REM
460 REM APPLESOFT INPUT USING
470 REM INPUTS THE 3 LINES
480 FOR X = 1 TO 3
490 POKE MXL,ML%(X): REM LENGTH
500 HTAB 10: REM FOR INPUT
510 CALL AIU: REM THE ROUTINE
520 A$(X) = MID$ (IN$,1)
530 NEXT X
540 REM
550 REM NOW PROVE IT WORKS BY
560 REM WRITING A$ ARRAY TO
570 REM DISK AND READING THE
580 REM DATA BACK AS B$ ARRAY
590 REM
600 REM NORMAL SYNTAX TO WRITE
610 VTAB 6: HTAB 7: INVERSE : PRINT "WRITING A$ (1-3) TO THE DISK"
620 PRINT CHR$(4)"OPEN AIU.DEMO.TEXT"
630 PRINT CHR$(4)"DELETE AIU.DEMO.TEXT"
640 PRINT CHR$(4)"OPEN AIU.DEMO.TEXT"
650 PRINT CHR$(4)"WRITE AIU.DEMO.TEXT"
660 FOR Y = 1 TO 3
670 PRINT A$(Y)
680 NEXT
690 PRINT CHR$(4)"CLOSE"
700 REM
710 REM CALL ROUTINE TO READ
720 VTAB 6: HTAB 7: INVERSE : PRINT "READING DATA BACK AS B$(1-3)": NORMAL
730 PRINT CHR$(4)"OPEN AIU.DEMO.TEXT"
740 PRINT CHR$(4)"READ AIU.DEMO.TEXT"
750 FOR Y = 1 TO 3
760 CALL AIU:B$(Y) = MID$ (IN$,1)
770 NEXT
780 PRINT CHR$(4)"CLOSE"
790 REM
800 REM THE FINAL PROOF
810 VTAB 6: HTAB 1: CALL -868
820 FOR Z = 1 TO 3
830 PRINT "B$("Z")="B$(Z)
840 NEXT