=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 03-01-93 (15:01) Number: 20 From: VICTOR YIU Refer#: NONE To: ALL Recvd: NO Subj: PostIt! 5.0 5/11 Conf: (35) Quick Basi --------------------------------------------------------------------------- '>>> Start of page 5. ' Shaved several bytes... -VY PRINT #2, "CLS:?STRING$(50,178):DEFINT A-Z 'Created by PostIt! v5.0" PRINT #2, "Y$=" + Qt$; ComprChar$; Qt$; ":FOR A=0 TO"+_ " 6:P(A)=2^A:NEXT:OPEN "; Qt$; "B"; Qt$; ",1,"; Qt$; Real.Source$ PRINT #2, "T$="; Qt$; "abcdefghijklmnopqrstuvwxyz"; Qt$;_ ":T$=T$+UCASE$(T$)+"; Qt$; "0123456789()" 'Encode file. This could be sped up quite a bit if a large input buffer 'was used(that will come in the next version!)... ' no more waiting.... buffer implemented... -VY DO CurrentByte = SEEK(1) L& = FileLength - CurrentByte + 1 ' what's left? SELECT CASE L& CASE IS > 4096 Block$ = SPACE$(4096) CASE IS <= 0 EXIT DO CASE ELSE Block$ = SPACE$(L&) ' rest of it END SELECT GET #1, , Block$ FOR Pointr = 1 TO LEN(Block$) IF (Pointr AND 15) = 0 THEN CurrentByte = CurrentByte + 16 Twirl END IF PutBytes ASC(MID$(Block$, Pointr, 1)) NEXT LOOP 'flush the input buffer if it contains any bits IF CurrentBit > 0 THEN PutByte Char 'flush the line buffer if it contains any characters 'Add a CHR$(34) to it just in case a mail reader decides to add 'some extra spaces to the end... IF LEN(Work$) > 2 THEN Print.Line Work$ + CHR$(34) 'Main loader originally reduced from 8 lines to 6 lines by Jim Giordano 'Thanks Jim! 'Slight modifications to the 6 line loader by Rich Geldreich 'More modifications to the loader to implement compressed code, increased ' to ~7.2 lines by Victor Yiu Print.Line "N=" + Num2Str$(FileLength) + ":K=255:IF LEN(C$)<>" +_ Num2Str$(BytesOut) + " THEN ?" + Qt$ + "Incomplete script!" + Qt$ +_ ":END" Print.Line "FOR A=1 TO N:LOCATE 1:?STRING$(50/N*A,177):IF L=0 THEN GOSUB"+_ " G:L=6" Print.Line "W=T\P(6-L):GOSUB G:W=W OR T*P(L):L=L-2:B$=CHR$(W AND K):PUT"+_ " 1,,B$:NEXT" Print.Line "?:IF C=" + Num2Str$(CheckSum) + " THEN ?" + Qt$ + "Ok" + Qt$_ + ":END ELSE ?" + Qt$ + "Bad checksum!" + Qt$ + ":END" Print.Line "G:I=I+1:T=INSTR(T$,MID$(C$,I,1))-1:C=(C+T)*2:C=C\256+(C AND"+_ " 255):RETURN" Print.Line "SUB G(A$):SHARED C$,Y$:FOR X=1 TO"+_ " LEN(A$):B$=MID$(A$,X,1):S=INSTR(Y$,B$)" Print.Line "IF S THEN C$=C$+STRING$(S+1,97) ELSE C$=C$+B$" Print.Line "NEXT:END SUB" CLOSE LOCATE Row, Col T! = TIMER - T! PRINT " " PRINT PRINT "....Done!" PRINT PRINT Total.Lines.Out; "lines in"; Current.Page; "file(s) written." PRINT USING "Elapsed time: ##.# secs."; T! COLOR 7: LOCATE , , 1, 6, 7 END CheckForFile: OPEN source.file$ FOR BINARY AS #1 A& = LOF(1) IF A& = 0 THEN CLOSE KILL source.file$ PRINT "File not found." END IF RETURN '>>> Continued on page 6. --- Blue Wave/RA v2.10 [NR] * Origin: Hard Disc Cafe / Houston Texas / (713) 589-2690 / Node -*N (1:106/30. 0) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20