home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Killer
/
Game_Killer.bin
/
073.FORM.BAS
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
4KB
|
96 lines
100 REM
110 REM General Purpose Input Subroutine
120 REM by Randy Hawkins for ONE THOUSAND Magazine
130 REM (c) Copyright 1990, One Thousand Magazine and Randy Hawkins
140 REM All Rights Reserved
150 REM
155 COMMON RH: IF RH = 0 THEN SYSTEM
160 DIM FX(10), FY(10), FL(10), F$(10), Q$(10)
170 SCREEN 0: WIDTH 80: KEY OFF: COLOR 2,0: CLS
180 REM
190 REM Prepare for Call to Input Routine
200 REM
210 FC = 2: BC = 0: DOT = 254: NF = 5
220 LOCATE 6,16: PRINT "First Name:"
230 FX(1) = 28: FY(1) = 6: FL(1) = 20
240 LOCATE 7,17: PRINT "Last Name:"
250 FX(2) = 28: FY(2) = 7: FL(2) = 20
260 LOCATE 9,12: PRINT "Street Address:"
270 FX(3) = 28: FY(3) = 9: FL(3) = 40
280 LOCATE 10,12: PRINT "City and State:"
290 FX(4) = 28: FY(4) = 10: FL(4) = 40
300 LOCATE 11,18: PRINT "Zip Code:"
310 FX(5) = 28: FY(5) = 11: FL(5) = 5
320 GOSUB 1000
330 REM
340 REM Want to Make a Change in Data Entered?
350 REM
360 LOCATE 14,28: PRINT "Edit Data Above (Y/N)?";
370 COLOR 18: PRINT CHR$(32); CHR$(95): COLOR 2
380 I$ = INKEY$: IF I$ = "" THEN 380
385 IF I$ = CHR$(27) THEN 520
390 IF I$ = "N" OR I$ = "n" THEN 450
400 IF I$ <> "Y" AND I$ <> "y" THEN 380
410 LOCATE 14,28: PRINT STRING$(30,32): GOTO 320
420 REM
430 REM Want to Make Another Entry?
440 REM
450 LOCATE 14,28: PRINT "Make a New Entry (Y/N)?";
460 COLOR 18: PRINT CHR$(32); CHR$(95): COLOR 2
470 I$ = INKEY$: IF I$ = "" THEN 470
480 IF I$ = "N" OR I$ = "n" OR I$ = CHR$(27) THEN 520
490 IF I$ <> "Y" AND I$ <> "y" THEN 470
500 LOCATE 14,28: PRINT STRING$(30,32)
510 FOR A = 1 TO NF: F$(A) = "": NEXT A: GOTO 320
520 CLS: LOCATE 12, 30: PRINT "One Moment Please...": RUN "menu"
970 REM
980 REM Start of Input Subroutine
990 REM
1000 GOSUB 1430: CF = 1: CP = 0
1010 LOCATE FY(CF), FX(CF)+CP, 0: COLOR BC,FC
1020 PRINT MID$(Q$(CF), CP+1, 1); CHR$(29);: COLOR FC,BC
1030 I$ = INKEY$: IF I$ = "" THEN 1030
1040 PRINT MID$(Q$(CF), CP+1, 1);: IF ASC(I$) = 0 THEN 1240
1050 REM
1060 REM Check for BACK SPACE, ENTER, or ESC
1070 REM
1080 IF I$ = CHR$(8) AND CP = 0 THEN 1010
1090 IF I$ = CHR$(8) THEN CP = CP - 1: GOTO 1360
1100 IF I$ = CHR$(13) AND CF < NF THEN CP = 0: GOTO 1330
1110 IF I$ = CHR$(13) OR I$ = CHR$(27) THEN 1180
1120 IF I$ < CHR$(32) OR I$ > CHR$(126) THEN 1010
1130 Q$(CF) = LEFT$(Q$(CF),CP) + I$ + MID$(Q$(CF),CP+2)
1140 LOCATE FY(CF),FX(CF): PRINT Q$(CF): GOTO 1320
1150 REM
1160 REM Clean Up Entries in F$ then Exit
1170 REM
1180 FOR A = 1 TO NF: B = INSTR(Q$(A),CHR$(DOT))
1190 IF B = 0 THEN B = FL(A) + 1
1200 F$(A) = LEFT$(Q$(A),B-1): NEXT A: GOTO 1430
1210 REM
1220 REM Special Keys: Arrows, INSERT, and DELETE
1230 REM
1240 I$ = RIGHT$(I$,1): A = INSTR("HKMPRS",I$) + 1
1250 ON A GOTO 1010, 1260, 1300, 1310, 1330, 1340, 1360
1260 CF = CF + (CF > 1)
1270 IF CP > FL(CF) - 1 THEN CP = FL(CF) - 1
1280 IF MID$(Q$(CF), CP+1, 1) <> CHR$(DOT) THEN 1010
1290 IF CP = 0 THEN 1010 ELSE CP = CP - 1: GOTO 1280
1300 CP = CP + (CP > 0): GOTO 1010
1310 IF MID$(Q$(CF), CP + 1, 2) = STRING$(2,DOT) THEN 1010
1320 CP = CP - (CP < FL(CF) - 1): GOTO 1010
1330 CF = CF - (CF < NF): GOTO 1270
1340 Q$(CF) = LEFT$(Q$(CF), CP) + CHR$(32) + MID$(Q$(CF), CP+1)
1350 Q$(CF) = LEFT$(Q$(CF), FL(CF)): GOTO 1370
1360 Q$(CF) = LEFT$(Q$(CF), CP) + MID$(Q$(CF), CP+2) + CHR$(DOT)
1370 CP = CP - 1: GOTO 1140
1380 REM
1390 REM Subroutine to Move Raw Data in Array F$
1400 REM into Array Q$ (padded with DOT characters)
1410 REM then Display Using FX and FY Locations
1420 REM
1430 FOR A = 1 TO NF: Q$ = F$(A): WHILE RIGHT$(Q$,1) = CHR$(32)
1440 Q$ = LEFT$(Q$, LEN(Q$)-1): WEND: F$(A) = LEFT$(Q$, FL(A))
1450 Q$(A) = F$(A) + STRING$(FL(A)-LEN(Q$), DOT)
1460 LOCATE FY(A),FX(A): PRINT Q$(A): NEXT A: RETURN