PDA

View Full Version : file.copy /w variable


Endymion1
12-12-2003, 09:36 PM
I feel like I'm missing something here, I was fluent in AMS 4, now that I've moved to AMS 5 I am impressed but it is much more technical, which is good, but I need time to learn.

Anyways, can you have variables in a file.copy? here is what I want to do:

abc = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "file (abc.exe)|abc.exe|", "", "dat", false, true);

File.Copy("abc"(this is a newer, different file from CD) , abcthis is the variable, can i not use it? do i need a string? , true, true, false, true, nil);

Please help

kpsmith
12-12-2003, 10:44 PM
I stumbled and cursed through the same thing last night...

The reason it's not working is the FileBrowse Dialog is storing the user defined path to a table called "abc" not a variable called "abc"

It stores the path as record 1 in the table.

So your second action should call abc[1] without quotes. This basically means get record 1 from the table abc.

File.Copy(DestinationPath, abc[1], true, true, false, true, nil);

Endymion1
12-13-2003, 09:23 AM
Jeese, thanks how could I miss that, especially when you can have multiple files! I feel so bad, I should have known.:rolleyes:

Thanks! ;)