Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Findin' Text

Status
Not open for further replies.

XerxesTheMighty

Programmer
Jun 15, 2003
72
US
Lets say I have a file called data.dat(or a string stored). I load the file in my program, but I don't want the user to see it (like searching a database). How would I search that string or file, without the user knowing?

Apocalyptic Programmer
 
I'm not sure I understand the question.

If, for example I had a CSV list or a parseable configuration file that I wanted info from 'on the fly' then I would create a linked list (or DPA) of structs/bins and just parse the information I needed into memory at load time. This requires no UI.

If you really need the entire file in memory then all you have to do is reserve a large enough buffer and copy.Your pointer to the buffer then acts as your 'index' for parsing.

Sorry if I've misunderstood - if you provide more details of what you want to do I'm sure someone can provide a fuller answer.


 
K, i've got the file into a buffer--but forget about that now.
I have a string, and without the user knowing I want to search that string for a string. Kinda like "Find" and "Find and Replace", only without the GUI (without the user knowing [and no replacing]).

--------------
Xerxes Dynatos
 
I would have thought you would simply use strstr() or some similar string class function.
 
strstr() doesn't work, and the Find/Replace dialog doesn't work either. Perhaps I could put it into a drop-down list and search the list, and I saw in the .h (header) LB_FINDSTRINGEXACT. But I can't figure how to work it though.

--------------
Xerxes Dynatos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top