ZLib Compose txt file please?

Blitz3D Forums/Blitz3D Programming/ZLib Compose txt file please?

Caton(Posted March) [#1]
Could somebody help me just read a text file and compose the text file?



gpete(Posted March) [#2]
Why don't you try using WriteLine$ and ReadLine$ ?
Just look at the Help- Command Reference under 2D

WriteLine$ (filehandle|stream, string$)
Once you've opened a disk file (or stream) for writing, use this command to right a whole line of text to the file. Each line of text is automatically terminated with an "end-of-line" mark, consisting of a Carriage Return character followed by a LineFeed character. (i.e. 0Dh, 0Ah ) This function can be used to make plain text files.


Caton(Posted March) [#3]
I want to compress a Data file


hollifd(Posted March) [#4]
Something like this might work:

;Read a file...
file=OpenFile("C:\junk.txt")
While Not Eof(file)
	Hold$ = ReadLine$(file)
	DebugLog Hold$
Wend
CloseFile(file)


;Write to a file...
MyFileName$ = "C:\junk.txt"
fileout = WriteFile(MyFileName$)
WriteLine(fileout), "Hello World!"
CloseFile(fileout)





gpete(Posted March) [#5]
no point in "compressing data files", memory and disk space virtually unlimited nowadays. If you want to make something "secret" or "private" just use a simple letter formula value shifter- it will look like gibberish in a text file.


degac(Posted March) [#6]
.. sorry, wrong forum