PDA

View Full Version : Global Variables


lance
03-24-2004, 01:26 PM
Is there a global variable for just the c:\ for example _WindowsFolder = C:\Windows or
_SystemFolder = C:\Windows\System

I'm looking for just the root of C:\

Thanks
Lance

Worm
03-24-2004, 01:46 PM
If you want the Root of the Drive that windows is on, you could do this:

WindowsRoot=String.Left(_WindowsFolder, 3)

TJ_Tigger
03-24-2004, 02:21 PM
Or you could use this

_CFolder = "C:\\"

lance
03-24-2004, 02:50 PM
Yes but what I'm doing is searhing for a file. I do not know where the file is. If I creat a _cfolder = "c:\\" and use that in the
file.doesexist then it will only search the root of the c drive I need it to search all of the c drive not just the root.

rhosk
03-24-2004, 03:14 PM
I already answered this in a prior thread. If it's only the "C:\ drive" that you're concerned with (and not a source drive or something else), then all you need to do is search for the file, populate a table and ""recurse"" the sub-folders. Recurse meaning to search any and all folders/sub-folders on the C:\ drive. May take a while on some systems.

lance
03-25-2004, 07:50 AM
The problem is I need a true or false not the location of the file put into the Result variable..

TJ_Tigger
03-25-2004, 08:53 AM
Use File.Find instead to search recursively through the directories. If the returned variable is nil then your file was not found

result = File.Find("C:\\", "yourfile.ext", true, true, nil);
if result == nil then
--your file was not found
else
--do something with the file here
end

lance
03-25-2004, 02:17 PM
Excellent got it to work thanks !!!!!