Re:3 easy problem i think, Help Help
Quote
S{*word*249} B?rlum <s{*word*249}.bor...@mbox300.swipnet.se> wrote:
>2.How can i make a check for a fil, if is there.
From the Delphi v2.0 Help file:
Declaration
function FileExists(const FileName: string): Boolean;
Description
The FileExists function returns True if the file specified by FileName
exists. If the file does not exist, FileExists returns False.
Quote
>3.My program make a ini file, but default is windows dir.
> How can i make it too save in the app dir (but not by default).
> I mean if it is on anothere pc, then it can by my dir.
For an executable, 'Application.EXEName' contains the full path and
file name of the executable. What I do is use a small function that I
maintain in my set of "stock" units called GetDirectory. I pass the
EXEName property to the function, which simply steps backward through
the string until it hits a backslash, then returns
'COPY(InputString,1,BackslashPosition). You can use that return value
as the location for the program-specific .INI file (e.g.,
"INIFile.Create(ProgramDirectory+'XXX.INI')", where ProgramDirectory
is the return value from the GetDirectory function).
I hope this has been both helpful and clear (but I'd prefer helpful!)
H.B. Taylor