[b][red]This message was edited by mydelphi at 2003-7-20 9:13:34[/red][/b][hr]
[b][red]This message was edited by mydelphi at 2003-7-20 9:11:35[/red][/b][hr]
I'm looking for some suggestions.
I've pretty much exhausted myself of a theral search in all of my
libraries of books for any example or hints or whatever,
Mastering Delphi 3
Secrets of Delphi 2
Delphi 3 Super Bible
And several other books
Plus, the Internet (doing actual web searches)
So, here I am, asking some more questions.
Ok then, I have, yet another problem. I'm trying to STORE my controls
values into a file. I've mimiced ONLY the controls values/property
that I will end up using.
I've thought about using the TIniFle unit and save to and INI file,
and this would be simple, if all I was doing was saving ONE dementional
strings, Intergers, even checkbox values ie, .checked=boolean,
but that turned out to be a bad idea. If I have a combobox for instance,
with a list of items, say 15 of them, how am I going to store them in this
INI file structure, and then put them back into the combobox later, and
I go to retreave the complete file (control structure on my form)
I would love to just store the ALL the controls AND their values from my
form, and just recall them as they were last set, but after trying that,
using a file structure below, either my system would crash or I did not
get back my values (they did not get stored?)
TmyControls = record
txtTmpListLastStr: String; // last highlisted string
F : file of TmyControls;
myControlsRecStruc.txtTmpListLastStr := form1.txtTmpListLastStr;
myControlsRecStruc.cbTmpList := form1.cbTmpList.checked;
myControlsRecStruc.chbYesNo := form1.chbYesNo;
myControlsRecStruc.txtSize := form1.txtSize;
// Write the data to our file structure
// Read the data back, from our file structure, into our Controls
// populate our Controls from file structure here.
Not to forget that all the above are Controls on my form.
but the above presents too many problems:
1 - combobox: If I add a new item (which I will) how to they get inserted
and properly sorted. If I have a mechanism for storing the last position
or selection in the combobox, and I go and insert a new item into this
list, won't I throw off the order AND the new item ?
2 - some of my controls are mixed values. Example, there are some
Intergers, Strings (only works if I say String[nnn], NOT String) and
checkboxes. I use/store the chbYesNo.checked values.
I'm sorry for being so lenghthy, but it was difficult to explain.
I was sure I read somewhere's in one of my Books on how to do this, but I
could not find anything in my latest search.
I really hope that it's something very simple that I over looked :-)
Thank you for any suggestions :-)
0 · ·