From: Jeff Johnson on 16 Jun 2010 11:53 "mp" <nospam(a)thanks.com> wrote in message news:hv9am3$8p8$1(a)news.eternal-september.org... > Given a form with a reference to a list of strings... "reference to a list of strings." Sounds a bit .NET-y, like Cor said. This group is for VB6 and earlier. Are you in the right place?
From: mp on 16 Jun 2010 13:52 Thanks for that clarification Cor. I'm in VB6 in this case, thus posted here, rather than to the dotnet group. Yes, by list of string, i'm using the term conversationally, i.e. a "bunch" of strings. They happen to be stored in a cSortedDictionary (Thanks Olaf!) as a start I went the text file route so after reading the file i used split to create an array of strings momentarily which i then put back in the dictionary. "Cor Ligthert[MVP]" <Notmyfirstname(a)planet.nl> wrote in message news:eisM1GSDLHA.5436(a)TK2MSFTNGP04.phx.gbl... > > Which language version of VB are you using. > > List of String is a class from .Net framework 2.0 and latter ( VB 2005 and > latter). > > But it can of course also be your description of an array of strings in > VB6 > > > "mp" <nospam(a)thanks.com> wrote in message > news:hv9am3$8p8$1(a)news.eternal-september.org... >> Given a form with a reference to a list of strings... >> >> What would be the easiest way to 'serialize' the contained data (list of >> strings) >> by easiest i mean easiest for a dummy like me to learn how to do >> >> so on program start the form could look on disk to find it's last saved >> state of collected strings >> >> i could just write to text file (tacky but it does meet the easy >> requirement) >> or ini file (i could figure that out - have done once maybe) >> or xml file (i maybe could figure that out - have read about) >> >> since it's just a prog for me it doesn't have to be elegant but i >> wouldn't mind learning some new hip technique >> >> thanks for any ideas >> mark >> >>
From: mp on 16 Jun 2010 13:59 "Jeff Johnson" <i.get(a)enough.spam> wrote in message news:hvas1o$75f$1(a)news.eternal-september.org... > "mp" <nospam(a)thanks.com> wrote in message > news:hv9am3$8p8$1(a)news.eternal-september.org... > >> Given a form with a reference to a list of strings... > > "reference to a list of strings." Sounds a bit .NET-y, like Cor said. This > group is for VB6 and earlier. Are you in the right place? yes, see my response to Cor...i agree my loose language was easily misconstrued. originally programming in lisp, I still think of a group of stuff being a "list" whether it's now stored in an array, collection, dictionary etc....I'll be more clear in the future. :-) Thanks mark
From: mp on 16 Jun 2010 14:08 "Mayayana" <mayayana(a)invalid.nospam> wrote in message news:hvaidu$td0$1(a)news.eternal-september.org... > I'm using a method I like a lot. I think I > originally got the idea from Larry Serflaten. > > It turns out that a UDT can be read from/written > to disk as a binary file. Despite the string values > being pointers, VB will nevertheless write all data > stored in the UDT in serial fashion! > > So I declare a large UDT in the program to hold > various settings of all types. At startup I fill the > UDT by reading in a settings.dat binary file. If the > file isn't there I write it with an empty UDT, which > accords with default settings. At program close I > write the current UDT to disk. During operation I > refer to the UDT members to get or change settings > values. > > It's a very clean, simple method with room for > expansion, and it provides intellisense at design > time for referencing settings variables. > hmm sounds interesting you don't have a small sample you'd be willing to share by chance? (just the write udt to disk, read udt from disk part) thanks mark
From: mp on 16 Jun 2010 14:13
"Larry Serflaten" <serflaten(a)gmail.com> wrote in message news:hvapik$hls$1(a)news.eternal-september.org... > > "mp" <nospam(a)thanks.com> wrote >> Given a form with a reference to a list of strings... >> >> What would be the easiest way to 'serialize' the contained data (list of >> strings) >> by easiest i mean easiest for a dummy like me to learn how to do > > There is not enough information to determine the best approach. > > 1. Are the strings all the same size? no > 2. Does the list change size at any time? yes > > 1a If the strings are the same size, make one big string out of all of > them and save that to a file. When you read it back in, you just > chop up the data to get your original strings. > > 2a If the list changes size, just print them to a file and read them back > in. The file itself will determine how many strings are required. that's what i did, just felt amatureish (since i knew how to do it) :-) the strings are folder names. I select various folders whose files i want to see, and for each folder selected a listbox is added to the form populated with the contained files. when i close the form i save the "list" of folders and on startup, repopulate the form with the appropriate number of listboxes pointing to the respective folders. then in different or additional folders are chosen the "list" is rewritten on exit. > If the list always has the same number, check out Mayayana's reply. that could come in handy for other info, like form position, width, height etc. I'm going to check that out too... thanks to you both! :-) mark > > How would you do it? The best way (for you) will always be a method > you fully understand... ;-) there is nothing in this world i *fully* understand :-) |