To be entered into QBasic which can be found on Windows software under the oldmsdos folder.
THIS$="THISFILE.BAS"
THAT$="FILELOG.DOC"
OPEN THIS$ FOR RANDOM AS #1 LEN=1
OPEN THAT$ FOR RANDOM AS #2 LEN=1
SIZE&=LOF(1)*
FOR LETTER&=1 TO LOF(1)
FIELD #1, 1 AS LETTER$
FIELD #2, 1 AS LETTER$
GET #1, LETTER&
PUT #2, LOF(2)+2
GET #2, LOF(2)-1
MM&=ASC(LETTER&)
PRINT MM&;" ";
LETTER$=CHR$(PEEK(MM&))
PUT #1, SIZE&+LETTER&
NEXT LETTER&
CLOSE
OPEN THIS$ FOR BINARY AS #1
DLT$="'"
RN$="RUN THIS$"
PUT #1, SIZE&-LEN(RN$)**, DLT$
FOR LETTER&=1 TO LEN(RN$)
LETTER$=MID$(RN$, LETTER&, 1)
PUT #1, LOF(1)+1, LETTER$
NEXT LETTER&
CLOSE
RUN THIS$
*This value must be input manually because the length of the file grows. Perhaps you could write a code to discover this value:
FILE$="FILENAME"
OPEN FILE$ FOR RANDOM AS #1 LEN=1
PRINT LOF(1)
CLOSE
**The length of RN$ is not a sufficient value but 'SIZE&-12' should be.
ENJOY
THIS$="THISFILE.BAS"
THAT$="FILELOG.DOC"
OPEN THIS$ FOR RANDOM AS #1 LEN=1
OPEN THAT$ FOR RANDOM AS #2 LEN=1
SIZE&=LOF(1)*
FOR LETTER&=1 TO LOF(1)
FIELD #1, 1 AS LETTER$
FIELD #2, 1 AS LETTER$
GET #1, LETTER&
PUT #2, LOF(2)+2
GET #2, LOF(2)-1
MM&=ASC(LETTER&)
PRINT MM&;" ";
LETTER$=CHR$(PEEK(MM&))
PUT #1, SIZE&+LETTER&
NEXT LETTER&
CLOSE
OPEN THIS$ FOR BINARY AS #1
DLT$="'"
RN$="RUN THIS$"
PUT #1, SIZE&-LEN(RN$)**, DLT$
FOR LETTER&=1 TO LEN(RN$)
LETTER$=MID$(RN$, LETTER&, 1)
PUT #1, LOF(1)+1, LETTER$
NEXT LETTER&
CLOSE
RUN THIS$
*This value must be input manually because the length of the file grows. Perhaps you could write a code to discover this value:
FILE$="FILENAME"
OPEN FILE$ FOR RANDOM AS #1 LEN=1
PRINT LOF(1)
CLOSE
**The length of RN$ is not a sufficient value but 'SIZE&-12' should be.
ENJOY
Last edited: