Board index » cppbuilder » Saving Appearance Data

Saving Appearance Data

What would be the easiest way that I could implement to save the user chosen
color properties of certain texts on a form to a pre chosen file. The colors
are stored in the Color property of ColorDialogs 1-5. And the file woud be
C:\program files\bob\colors.npf, just so i can use something with a path in
it cuz i couldn't get that to work either. My origional idea was to write
them all to an edit box, but after doing so, many values were 0 and it never
loeaded properly cuz it couldn't convert the string to an integer. So, what
is the easiest way to take  care of all of this, my goal being to accomplish
auto-saved appearance settings?

Thanks in advance,
~Fission

 

Re:Saving Appearance Data


Hi Fission,

    I am not quite sure what you mean, but you could use an .ini file to
store those preferences.

    See, TIniFile for references. There are some examples too.

    The problem concerning paths, could be related to the following:

    (Quote from "Escape sequences" in helpfile)

        Note: You must use \\ to represent an ASCII backslash, as used in
operating system paths.

    (End quote)

    Converting strings to integer can be done by: myInt =
StrToInt(myString);

    But, then again ... I might not understand your problems =)

Greetings,
Ramses Matabadal

Doctor Fission <fiss...@nightfission.com> schreef in berichtnieuws
3b56df29_2@dnews...

Quote
> What would be the easiest way that I could implement to save the user
chosen
> color properties of certain texts on a form to a pre chosen file. The
colors
> are stored in the Color property of ColorDialogs 1-5. And the file woud be
> C:\program files\bob\colors.npf, just so i can use something with a path
in
> it cuz i couldn't get that to work either. My origional idea was to write
> them all to an edit box, but after doing so, many values were 0 and it
never
> loeaded properly cuz it couldn't convert the string to an integer. So,
what
> is the easiest way to take  care of all of this, my goal being to
accomplish
> auto-saved appearance settings?

> Thanks in advance,
> ~Fission

Re:Saving Appearance Data


GAH! Still can't quite make it work, one last detail.

Incoming->Color = Memo1->Lines[1];

Incoming is derived from TColorDialog, it won't work!!!
It looks like the Color property is an AnsiString, but shouldn't it work
fine like this then?

*Confused*

Any help would be appreciated, thanks again
~Fission

Re:Saving Appearance Data


I see you try to be timely as well, it is much appreciated. Sorry I couldn't
offer a bit more to your problem and I hope it all ends up working out as u
intended it to. As for me, I'm trying out what you just tipped me off on =)

Much thanks,
~Fission

Re:Saving Appearance Data


why not use the registry????

Quote
Doctor Fission <fiss...@nightfission.com> wrote in message

news:3b56ea03_1@dnews...
Quote
> GAH! Still can't quite make it work, one last detail.

> Incoming->Color = Memo1->Lines[1];

> Incoming is derived from TColorDialog, it won't work!!!
> It looks like the Color property is an AnsiString, but shouldn't it work
> fine like this then?

> *Confused*

> Any help would be appreciated, thanks again
> ~Fission

Re:Saving Appearance Data


I could... but i have no clue how to. :-D

Besides, what advanteages does using the registry hold?

Other Threads