PDA

View Full Version : Problems with variable


sside
06-23-2004, 09:17 AM
Hello everybody

I'm having some troubles with the following code:
-------------------------------------------------------------------------
select_folder = Dialog.FolderBrowse("Please select a folder:", "AutoPlay\\Docs");

if select_folder == "CANCEL" then
result = Dialog.Message("Notice", "Canceled by user", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
else
Flash.SetVisible("Flash1", true);
File.Copy("AutoPlay\\Docs\\*.*", select_folder, true, true, false, true, Progress)
Flash.SetVisible("Flash1", false);
end

result_file = File.DoesExist("select_folder\\file.txt");

if result_file == true then
result = Dialog.Message("Notice", "yes, does exist", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
else
result = Dialog.Message("Notice", "no, it doesn't", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
--------------------------------------------------------------------
The idea is after i select the location for the files to be copied, after i want to see if the files really are copied to the path i browsed in the very beginning. So how do i place the variable where the path is stored (select_folder) here
--------------------------------------------------------------------
result_file = File.DoesExist("select_folder\\file.txt");
--------------------------------------------------------------------
Thank you

TJ_Tigger
06-23-2004, 10:32 AM
select_folder is a variable and needs to be concatenated to any strings, like the name of a file for instance.

your line of code

result_file = File.DoesExist("select_folder\\file.txt");


should be like this


result_file = File.DoesExist(select_folder .. "\\file.txt");


Since select_folder is a variable you want to use two periods to combine that variable with the file name, which is a string.

HTH
Tigg

sside
06-23-2004, 11:29 AM
Thank you for your time