PDA

View Full Version : Search & Copy


rhosk
10-30-2003, 12:25 PM
Hi, I'm doing a search for a file(s) and the way I have this setup, it finds more than one instance of the file (temp Internet Files in this case). I find the files OK and extract the variable, but how can I copy to %srcdir% just one of these files. File.Copy or File.Rename isn't working because of the >1 files it finds. Is there a way I can stop the search if it finds the very first instance of the file? Or any other tips? Thanks.

JimS
10-30-2003, 12:35 PM
Since File Search returns a delimited string, just copy or move the file from index 0 of that string.

rhosk
10-30-2003, 12:42 PM
Can you give me a kick start JimS? Never done the index 0 thing.

Worm
10-30-2003, 01:11 PM
you could parse the path\filename for the filename only, then use the wString DLL I wrote to remove the duplicates.

wString (http://www.warmuskerken.com/ams/wstring.zip)

JimS
10-30-2003, 01:20 PM
Here is a quick project to do it the way I was speaking of. Worm brings up a good point though; there is always more than one way to do something. You might want to try both ways and see what works best for your brain.

Corey
10-30-2003, 02:16 PM
Defintely feeling the flow from JimS these days. Nice to have another member of the posse who isn't shy to Betty Crocker up some sample files from time to time. :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

rhosk
10-30-2003, 02:26 PM
Both samples are great, thanks! Even if I don't use one or the other, still learning as I go here. I've gathered 10 pieces of info from those two files alone. Good stuff.

JimS
10-30-2003, 03:21 PM
Thanks for the nice words Corey. A few months ago when I was starting out with AMS, I had some big questions and wants myself. I stopped by here and was fortunate enough to get most of them answered by some super people. Thanks all you super people. A special big thanks goes out to Worm, he really went above and beyond to help me out. Since I haven’t been smart enough to help him out directly, I’m just doing what I can to help others. So far it’s still not much, especially compared to the help I received, but who knows maybe someday I’ll get at least even on the Karma thing.

Besides that, if I help answer the easy ones, it might give Worm a little extra time to write another killer DLL.

Corey
10-30-2003, 03:28 PM
Worm's a hard guy to help, he never asks for anything. :) But I think he gets joy out of seeing people he helps in turn help others with their new found powers. That's just speculation though...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

rhosk
10-30-2003, 04:46 PM
Besides that, if I help answer the easy ones, it might give Worm a little extra time to write another killer DLL.

Couldn't have said it better myself!! Worm rules! And [you guys] aren't so bad yourselves :D