Hello All
This program shows how flexible O2 is
its command PutFile filename , stringname
Putfile "Testfile.txt", myfileSt will
will save a string myfileSt into a binary file called Testfile.txt
while filestring = GetFile filename
will read the file and set the entire file data into a string
' Sav_BinFile.o2bas
' Program to save an entire string into a binary file.
' And to read another big file into a string then
' save this string into a new file
$filename "Sav_BinFile.exe"
use rtl64
use corewin
'----------------------------------------------------
' To save a string into a Binary file
string myfileSt
myfileSt = " this is my file string and needs to be stored in a binary file all at one go "+ chr(13,10) + _
" as much stuff as possible that you might want to " + chr(13,10) + _
" ya da ya da ya da "
Putfile "Testfile.txt", myfileSt
print " ok created the Testfile.txt"
'-------------------------------------------------------------------------------
' Now we read a 4.27 MB file "Te Whetu Shopping Mall.txt" into a string
' and then save it as another file
' called "New shopping mall.txt"
string BigFile_st
BigFile_st = Getfile "Te Whetu Shopping Mall.txt"
Putfile "New shopping mall.txt" , BigFile_st
print " ok have created a new file called New shopping mall.txt "