Page 1 of 1

Saving and loading of user settings

Posted: Mon Jul 02, 2007 1:22 pm
by 9524808
Since years we are using import.loadfromfile and export.savetofile to load and save user settings.
We wonder if there is not a better method for this.

We work as follows:
- we have 2 teechart objects on a form: TC and TCCopy
- suppose, TC is displayed with some data
- user now wants to see TC with other data

- at that moment we work as follows
a) save TC to hard disk
b) load saved chart into TCCopy
c) zorder(0) TCCopy
d) changes new data in TC, user can not see the changes because TC is behind TCCopy
e) zorder(0) TC when TC is ready

Using this method, our users, don't see the (ugly) rebuilding of the chart
Changes are down in a second

Has somebody any recommandation?
We tried with autorepaint=false, but autorepaint is always true when import is used.

Kind Regards :roll:

Posted: Mon Jul 02, 2007 1:35 pm
by narcis
Hi Bush,

Why don't you try exporting the original chart without its data? There's a boolean flag for this when saving a chart to a .tee file:

Code: Select all

procedure SaveToFile(Const FileName: WideString; IncludeData: WordBool);

Posted: Tue Jul 03, 2007 11:54 pm
by 9524808
Dear NarcĂ­s,

Mny thx your ultrasonore feedback speed.
I didn't know the export.asnative method :oops:
I removed the TCCopy and working with asnative is much better, much less code, faster response.

Kind regards. :)