Setup Factory 10

Folder.DoesExist

Folder.DoesExist

This is the first topic This is the last topic  

Folder.DoesExist

This is the first topic This is the last topic  

OverviewExamples

boolean Folder.DoesExist (

string Folder )

Example 1

does_exist = Folder.DoesExist("C:\\Magic");

Stores true in a variable named "does_exist" if the "Magic" folder exists at "C:\Magic", and false if it doesn't.

Note: _ProgramFilesFolder is a built-in variable that contains the path to the user's Program Files folder.

Example 2

bIs_There = Folder.DoesExist(_ProgramFilesFolder..\\Setup Factory XX");

Checks to see if the folder "Setup Factory XX" exists in the user's Program Files folder and stores either true or false accordingly in the variable "bIs_There." The concatenation operator (..) is used here to concatenate the Program Files folder path with "\Setup Factory XX."

Tip: Starting a variable name with "b" is a technique that programmers use to help themselves remember that a variable contains a boolean value.

Example 3

-- Check to see if a specific folder exists.

does_exist = Folder.DoesExist(_ProgramFilesFolder);

 

-- Display a dialog telling the user whether or not the folder exists.

if does_exist then

   Dialog.Message("Notice", "Yes, the folder does exist on your system.", MB_OK, MB_ICONINFORMATION);

else

   Dialog.Message("Notice", "No, the folder does not exist on your system.", MB_OK, MB_ICONINFORMATION);

end

Checks to see if the Program Files folder exists on the user's machine and notifies the user using a dialog message.

See also: Related Actions


Learn More: Indigo Rose Software - Setup Factory - Buy Now - Contact Us