PDA

View Full Version : im stuck :)


clueless
08-03-2006, 04:02 AM
Hi can anyone tell me why this bit of code wont work?

local SellectedGif = {};
local tDest = "";

tDest = _SourceFolder.."AutoPlay\\WorkingFolder\\";
tDest = tDest.."a.gif";

SellectedGif = Dialog.FileBrowse(true, "Locate the .Gif File", _DesktopFolder, "All Files (*.*)|*.*|", "", "gif", false, false);
if SellectedGif[1]~="" and SellectedGif[1]~=IDCANCEL then
SourceGif = SellectedGif[1];
File.Copy(SourceGif, tDest, true, true, false, true, nil);
if File.DoesExist(tDest) then
Label.SetVisible("gifOK", true);
Input.SetText("Input1",String.SplitPath(SourceGif).Filename..String.Spli tPath(SourceGif).Extension);
end
end

its a simple copy function but i cant seem to get it to run

clueless
08-03-2006, 04:27 AM
All its doing is getting the user to sellect a gif and then copy it to Autoplay\\WorkingFolder then check to see it it copied ok.As far as i can tell its down to the copy process. Ive put all sort of checks in and it seems to be building to paths to the files OK but nothing is getting copied.

TJS
08-03-2006, 05:02 AM
Here are a couple minor edits. Do you know how far it is getting? If not, try running the debug console... it can be a big help.


local SellectedGif = {};
local tDest = "";

tDest = _SourceFolder.."\\AutoPlay\\WorkingFolder\\";
tDest = tDest.."a.gif";

SellectedGif = Dialog.FileBrowse(true, "Locate the .Gif File", _DesktopFolder, "All Files (*.*)|*.*|", "", "gif", false, false);
if SellectedGif[1]~="" and SellectedGif[1]~="CANCEL" then
SourceGif = SellectedGif[1];
File.Copy(SourceGif, tDest, true, true, false, true, nil);
if File.DoesExist(tDest) then
Label.SetVisible("gifOK", true);
Input.SetText("Input1",String.SplitPath(SourceGif).Filename..String.Spli tPath(SourceGif).Extension);
end
end
end

clueless
08-03-2006, 05:11 AM
hey nice one :). That was driving me crazy :yes

Roboblue
08-03-2006, 05:15 AM
change this
tDest = _SourceFolder.."AutoPlay\\WorkingFolder\\";
to this
tDest = _SourceFolder.."\\AutoPlay\\WorkingFolder\\";
(change is in red)