| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 | 1. Problem searching dat-file #960 Posted by: 2003-05-21 21:21:56 | Hey!
Having some problems! I?ve created a program where i write data as strings to a dat-file, and now i want to make a search-function or a sub. I want to be able to search for a specific string and have the program returning all the saved data for that string.
Is there anyone who can help me? | 2. Re: Problem searching datfile #962 | Use QFileStream to read file into memory, then InStr to search: http://g.yi.org/_scripts/file.php?f=2492&r=2330 | 3. Re: Problem searching datfile #963 Posted by: 2003-05-22 17:10:05 | Hi Batteryman,
You could make an UDT with all the programs settings etc... and write/read the UDT to/from your file. Use the file.writeUDT and file.readUDT methods.
Or...
You could make a dat-file like this: <parameter name1> = <data1> <parameter name2> = <data2> ...and read it with a sub like this:
while file.position < file.size content = file.readline select case field$(content, "=", 1) case <parameter name1> : data1 = field$(content, "=", 2) case <parameter name2> : data2 = field$(content, "=", 2) end select wend
Kind regards, Alain
| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 |
|
|