'how to add pmf to project:
'1] write bas program
'2] create pmf file using DO_PMF, add files which need your program to PMF, this create potocol.txt file
'3] add ExtractPMF SUB and Extract_From_EXE SUB to your BAS file
'4] insert row which call extracting function -> Extract_From_EXE offset (offset is writed am end in file protocol.txt and printed also to screen in step 2) , EXEname (name of your program)
'5] Compile to EXE (NOT RUN!)
'6] in new IDE window run SUB Insert_PMF_to_EXE exe filename$, pmf filename$
'DONE. Run your upgraded EXE file.
SUB DO_PMF
'select files and add it to PMF container INPUT "Multirecorder. Record more files to one. How many files for record? ", pocet
IF pocet
< 1 THEN PRINT "Your choice is recording "; pocet;
"files to one file. ":
PRINT "Contact Chuck Norris for this operation.":
SLEEP 3:
END PRINT "Input file name - file"; loud:
INPUT fils
(loud
)
jmeno:
INPUT "Input OUTPUT filename:"; vystup$
identity$ = "Petr's MultiFile"
PUT #c
, , pocet:
SEEK #c
, 21 + pocet
* 4
PRINT "Saving...("; delky;
") -"; recs
(delky
)
jm$ = fils(names)
' PRINT fils(names)
PRINT #g
, "For using file "; vystup$;
"with SUB Extract_From_EXE use this value: ";
LOF(c
) PRINT "Completed. Lenght for rewriting back are writed in protocol.txt, parameter OFFSET for SUB Extract_From_EXE is: ";
LOF(c
)
PRINT "EXE file upgraded."
ExtractPMF "internalPMF.pmf"
SUB ExtractPMF
(Vystup
AS STRING) ' here insert PMF file name for extracting files PRINT "Extracting files from "; Vystup$
PRINT "Total records in file:"; head.much
FOR celek
= 1 TO head.much
SEEK #e
, 21 + head.much
* 4 ' start DATA area FOR total
= 1 TO head.much
IF total
= 1 THEN velikost&
= starts
(1) - (21 + head.much
* 4) ELSE velikost&
= starts
(total
) - starts
(total
- 1)
FOR NameIt
= 1 TO head.much
GET #e
, , NamesLenght
(NameIt
)
FOR Name2
= 1 TO head.much
s$
= SPACE$(NamesLenght
(Name2
)) erh:
BEEP:
INPUT "Warnig! Extracted file the same name already exists!!!! (O)verwrite, (R)ename or (E)xit? "; er$