5748260 [rkeene@sledge /home/rkeene/devel/archive/quickbasic]$ cat -n unk.bas
   1: DECLARE SUB Input2 (t$, otp$, cl$, c1%, c2%, c3%, pr!, cr!)
   2: DECLARE SUB COMPRESS (fil$, fil2$)
   3: SCREEN 0: WIDTH 80, 25
   4: CLS
   5: Input2 "&Compress, or &Decompress? ", Cod$, "&", 15, 0, 14, 1, 1
   6: 30 INPUT "Input file-->"; fil$
   7: IF fil$ = "" THEN GOTO 30
   8: 40 INPUT "Output File-->"; fil2$
   9: IF fil2$ = "" THEN GOTO 40
  10: OPEN fil$ FOR BINARY SHARED AS #1
  11: OPEN fil2$ FOR BINARY SHARED AS #2
  12: IF UCASE$(Cod$) = "C" THEN COMPRESS fil$, fil2$
  13: IF UCASE$(Cod$) = "D" THEN DECOMPRESS fil$, fil2$
  14: 
  15: SUB COMPRESS (fil$, fil2$)
  16: Input2 "&Are &you &crazy &or &something&!?&!?&!?", Cod$, "&", 15, 0, 14, 1, 1
  17: END SUB
  18: 
  19: SUB Input2 (t$, otp$, cl$, c1%, c2%, c3%, pr, cr)
  20: COLOR c1%, c2%
  21: IF cr = 1 THEN LOCATE , , 1
  22: FOR q = 1 TO LEN(t$)
  23: IF d = 2 THEN d = 0: COLOR c1%, c2%
  24: IF MID$(t$, q, 1) = cl$ THEN COLOR c3%, c2%: d = 2: q = q + 1: tmp$ = tmp$ + MID$(t$, q, 1)
  25: PRINT MID$(t$, q, 1);
  26: NEXT q
  27: 20 otp$ = INPUT$(1)
  28: FOR z = 1 TO LEN(tmp$)
  29: IF UCASE$(otp$) = UCASE$(MID$(tmp$, z, 1)) THEN GOTO 10
  30: NEXT z
  31: BEEP: GOTO 20
  32: 10 IF pr = 1 THEN PRINT UCASE$(otp$) ELSE PRINT ""
  33: END SUB
  34: 
5748261 [rkeene@sledge /home/rkeene/devel/archive/quickbasic]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2000-05-09 21:10:27