Page 1 of 1

random access files

Posted: Thu Dec 11, 2003 2:02 pm
by scurrier
random access and binary files would be great
this way you can save infomation that people dont need to see or want them to play with

or can someone who is good a c++ write a library or dll would rather have the lib to do random access files and or binary files

i tried but i dont know alot about lcc and it's a real pain in vcc to get it to be a lib for pb and as a dll it does this name mangling thing so my function thats called saverandom() is turned into !@#$%saverandom$%%^() or somthing like that

try calling that from PB
stupid M$.....
thanks
Sean

Re: random access files

Posted: Thu Dec 11, 2003 3:44 pm
by tinman
scurrier wrote:random access and binary files would be great
What do you mean? Random access files are supported (use FileSeek()) and using ReadByte(), WriteByte() etc allows you to work with binary files.

Posted: Fri Dec 12, 2003 5:03 am
by scurrier
yes that works but your file is in plain text format no to secure
i think it should make a binary file that looks like (*&@#$H& kmh
when you look at it in a text editor and what you saved

Posted: Fri Dec 12, 2003 10:32 am
by Froggerprogger
If you want to write something like *&@#$H& kmh in a file, you can do this, either as a string, or use WriteData. There's no problem about it.
Read/Write Byte/Word/Long/Float do read/write a simple number. Read/Write String do read/write a string - so it only contains 'ASCII-Chars (bytes)' without the 0. With Read/Write Data you can read/write whatever you want, the data of an image or anything else.

It's up to the programmer to save a string such as "Hello World" as "("§$%&/" You have to crypt it yourself.

Posted: Fri Dec 12, 2003 12:09 pm
by talun
Hi Scurrier,
maybe this link can be useful for you:
viewtopic.php?t=2396&highlight=writedata

bye

sergio

Posted: Sat Dec 13, 2003 3:17 am
by scurrier
thanks for the example but after i run and check the file it's still in plain text readble from notpad i am looking for something that saves it encrypted like the days of old basic that would save a binary or random access file that can not be undersood in a text editor i will see if i can find an example for you to see check back later

Posted: Sat Dec 13, 2003 4:48 am
by Paul
You could always try the DLL I made for my own use, which is available on the Resources Site in the DLL archive.