Log in

View Full Version : File functions...



gsquare567
04-14-2007, 03:36 PM
how do i CREATE a file, in the Scar divi manual it only says how to use an existing one... thanks!

~alex~
04-14-2007, 03:43 PM
RewriteFile() Im pretty sure that creates it if its not already there.

gsquare567
04-14-2007, 03:47 PM
ok, and how do i get a file's directory?
EDIT: nvm :) now i have a real problem - i see ReadFileString but it only returns a boolean, but i want to store what it reads =S how do i do that?

gsquare567
04-14-2007, 09:48 PM
procedure WriteINI(Section, KeyName, NewString, FileName: string);
Writes data to an ini-structured file.
Structure:
[Section]
KeyName=NewString

function ReadINI(Section, KeyName, FileName: string): string;
Reads data from an ini-structured file.
Structure:
[Section]
KeyName=NewString

those always give me an error saying the file doesnt permit the access, and function ReadFileString(FileNum: Integer; var s: string; Length: Integer): Boolean;
Reads Length number of bytes from file into string s.

this only returns a boolean. i need a string returned

EDIT: i read it again im stupid it does store, but now OpenFile gives me "File access error" sometimes, and how do i find out the length of a file im about to read...
EDIT AGAIN: nvm, figured it out. its tuff!