home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / prg / pretty.ba < prev    next >
Text File  |  2006-10-19  |  3KB  |  41 lines

  1. 0 'PRETTY.BA - BY WOODS MARTIN
  2. 1 'CLUB 100 LIBRARY - 415/939-1246 BBS,    937-5039 NEWSLETTER, 932-8856 VOICE
  3. 2 SCREEN,0:MAXFILES=1:CLEAR3000:DEFINTA-Z:DEFSNGD:DEFSTRS:DIMD,T,A,FC,FR,S,SS,FD,LL,LC,DL,W,LM,FQ,FP,S(127):SE=CHR$(27):SY=SE+"Y":SR=CHR$(13)+CHR$(10)
  4. 3 CLS:PRINT"PRETTY.100 [c] 03/31/85 *HONOR SYSTEM*"SR"If you keep and use please mail $5 to:"SRTAB(13)"Woods Martin"SR"   5517 Sturbridge Houston TX 77056"SR;SR"Reserved Words -":LM=6:RM=79:SF="":SU=""'printer param
  5. 4 SM=SPACE$(LM):FP=LM+7:SS=SPACE$(FP):LL=RM-LM:GOSUB20
  6. 5 GOSUB32:GOSUB37:OPENSOFOROUTPUTAS1:SH=SM+SP+"  "+DATE$+"  "+TIME$+"  Page":PG=0:GOSUB26:A=0:GOSUB16:FORD=DSTO65535:T=A:A=PEEK(D+1):IFFCTHEN7ELSEDL=PEEK(D+3)*256+PEEK(D+2):D=D+3:A=PEEK(D+1)
  7. 6 PRINT#1,SM;USING"##### ";DL;:FC=-1:W=LM+6:GOTO15
  8. 7 IFTTHEN9ELSEGOSUB17:GOSUB16
  9. 8 IFA+PEEK(D+2)=0THENGOSUB25:GOTO5ELSE15
  10. 9 IFNOTFRANDT=34THENFQ=(FQ=0):GOTO12ELSEIFFQTHEN12ELSEIF(T=58ANDA=142ANDPEEK(D+2)=255)THEND=D+1:A=PEEK(D+1):GOTO15
  11. 10 IFT=145THENGOSUB17:S=SSELSEIF(T=32ANDNOTFD)OR(T=58ANDA=145)THEN15
  12. 11 IFT=58THENGOSUB17:S=SS+": ":FD=0:FF=0:GOTO15ELSEIF((T=65ANDA=83)OR((LEN(S)>FP+2-W)AND(T=129ORT=136ORT=140)))ANDRIGHT$(S,1)<>" "THENS=S+" "
  13. 12 IFFDORFQORT<128THENS=S+CHR$(T)ELSES=S+S(T-128):IFT=161THENFF=1
  14. 13 IFFQTHEN15ELSEIFT=131THENFD=-1ELSEIFT=255OR(T=142ANDA<>255)THENFQ=-1:FR=-1ELSEIF(T=83ANDPEEK(D-1)=65)OR(T=132ANDA>36)THENS=S+" "ELSEIFT=137ORT=155ORT=158ORT=168ORT=169THENIFA<>77THENS=S+" "ELSES=S+"M ":D=D+1:A=PEEK(D+1)
  15. 14 IFFFTHENSI=RIGHT$(S,3)+" ":IFINSTR("INT STR SNG DBL ",SI)THENS=S+" "
  16. 15 NEXT:STOP
  17. 16 FC=0:FD=0:FF=0:FQ=0:FR=0:RETURN
  18. 17 IFLEN(S)<=LL-WTHENGOSUB24:W=0:RETURN
  19. 18 FORW2=LL-WTOLL-10-WSTEP-1:W1=ASC(MID$(S,W2)):IFW1=32ORW1=44ORW1=46ORW1=59ORW1=61THENW3=W2+(W1=32)ELSENEXT:W2=W2+1:W3=W2
  20. 19 ST="  "+MID$(S,W2+1):S=LEFT$(S,W3):GOSUB24:S=SS+ST:W=0:GOTO17
  21. 20 W=128:FORI=WTO609:T=PEEK(I):A=T+128*(T>127):IFI=128ORT<128THEN23ELSEIFW<219ANDINSTR(" $)68;=>?AHIJKLPTUW`cdefghipqrst",CHR$(W-96))=0THENS=S+" "
  22. 21 IFINSTR("amouvwxyz",CHR$(W-96))THENS=" "+S
  23. 22 S(W-128)=S:W=W+1:PRINTSY"%4"S;SE"K";:S=""
  24. 23 S=S+CHR$(A):NEXT:RETURN
  25. 24 GOSUB27:LC=LC+1:IFLC<59THENRETURNELSEGOSUB25:GOSUB26:RETURN
  26. 25 IFPATHENINPUT"Pause--insert paper <ENT>";SI:RETURNELSEIFLEN(SF)THENPRINT#1,SF;:RETURNELSES=STRING$(65-LC,10):GOSUB27:RETURN
  27. 26 LC=0:PG=PG+1:S=SH+STR$(PG):GOSUB24:S=SM+"   (produced by PRETTY.WM7)":GOSUB24:GOSUB24:RETURN
  28. 27 L=LEN(S):IFL=0THENS=" "
  29. 28 PRINT#1,S:S="":RETURN
  30. 29 BEEP:PRINTSY"% "SE"J"SI"<ENTER>";:SI="":INPUTSI:IFLEN(SI)=0THENRETURN
  31. 30 FORI=1TOLEN(SI):V=ASC(MID$(SI,I)):IFV>96ANDV<123THENMID$(SI,I,1)=CHR$(V-32)
  32. 31 NEXT:RETURN
  33. 32 SI="To: Line Printer=P  or Dev:Filnam.Ext"+SR+"   Quit=":GOSUB29:SO=SI:IFSI=""THENMENUELSEIFINSTR("LPT:",SO)=0THEN34ELSESO="LPT:":IF(INP(187)AND6)<>2THENSI="Printer not ready":GOSUB29:GOTO32
  34. 33 SI="Paper: single=S  continuous=":GOSUB29:PA=(SI="S"):IFLEN(SU)THENLPRINTSU;:RETURNELSERETURN
  35. 34 ONERRORGOTO35:IFINSTR(SO,":")=0THEN36ELSEOPENSOFOROUTPUTAS1:CLOSE:ONERRORGOTO2:SF="":PA=0:RETURN
  36. 35 RESUME36
  37. 36 ONERRORGOTO2:SI="Invalid output device":GOSUB29:GOTO32
  38. 37 CLOSE:CLS:FILES:SI="Program Name -  Quit=":GOSUB29:IFSI=""THENMENUELSEPRINT:SP=SI:T=INSTR(SP,"."):IFTTHENSP=LEFT$(SP,T-1)
  39. 38 SP=LEFT$(SP+SS,6):FORD=63919TO63919+11*19STEP11:T=PEEK(D):IFT=128ANDPEEK(D+3)=ASC(SP)THENFORI=2TO6:IFPEEK(D+2+I)=ASC(MID$(SP,I))THENNEXT:DS=256*PEEK(D+2)+PEEK(D+1):SP=SP+".BA":RETURN
  40. 39 NEXTD:SI=SP+".BA not found":GOSUB29:GOTO37
  41.