[lazarus] Compiler Options

Curtis White cwhite at aracnet.com
Mon Mar 20 01:30:50 EST 2000


I just commited a new version of the Compiler Options dialog to CVS. It
now saves the options in an XML file. But there are a couple of problems I
can't seem to be able to figure out. Can someone take a look at this and
see if you can see something obvious I am doing wrong?

Here are the problems.

In the TCompilerOptions class, in the Create method, it creates a
TXMLConfig object near the top. When this object is created, you pass in a
path to the XML file you want it to use. I have currently hardcoded the
path to /opt/fpc/lazarus/cplopts.xml.  So Windows users will need to
change this before you compile it, if you are going to go into the
Compiler Options dialog. The reason for the hardcoded path is that for
some reason the following method does not seem to be returning the path:

ExtractFilePath(ParamStr(0));

I wanted to extract the path of the exe and then use that path, but this
doesn't seem to be returning the path. I ran out of time to check, but I
am wondering if it is because I am running Lazarus by just typing in
"lazarus" at the command line, so there is no path to extract. But I don't
know for certain. Does anyone know?  And if that is the case, how can I
get the current directory in a way that is not specific to an OS?

The other problem I am having is  in the LoadCompilerOptions method of
that same class.  For some reason, it doesn't seem to be loading the
options back in. They are saving out just fine in the SaveCompilerOptions
method and I am using the exact same paths and methods (except Get instead
of Set) to load them. But it just keeps returning the Defaults instead of
the values loaded from the file. Can anyone tell me why this is
happening?  Is there a bug in the TXMLConfig class, or is there a problem
in my code?


Curtis







More information about the Lazarus mailing list