Bags
03-06-2006, 11:37 AM
Hi there, I just picked up the trial version of Autoplay 6. So far I like what I see although I have some issues.
First what I am trying to do is a File.Find function call with propper flags. I've searched though and found allot of examples but none seem to address the issue I have come across. Here is an example:
[inside a button click event]
fFile = "blah.exe";
sFile = File.Find(_SourceDrive, fFile, true, true, nil, nil);
if (sFile) then
for i, value in sFile do
Paragraph.SetText("Paragraph1", String.AbbreviateFilePath(value, 45));
-- do some more work
end
end
The above code works and displays the search progress in the paragraph object fine. You can see it going though the array and displaying each directory it looked in.
However, as soon as I write a function to handle the same thing and call the function from a button click event for instance, the progress does not display in the paragraph it just shows the fist directory in the array.
[inside button click event]
FindFile(_SourceDrive, "blah.exe");
[global function]
function FindFile(sPath, fFile)
sFile = File.Find(_SourceDrive, fFile, true, true, nil, nil);
if (sFile) then
for i, value in sFile do
Paragraph.SetText("Paragraph1", String.AbbreviateFilePath(value, 45));
-- do some more work
end
end
end
Any ideas why doing the same thing from a function call doesn't allow for the paragraph object to be updated?
First what I am trying to do is a File.Find function call with propper flags. I've searched though and found allot of examples but none seem to address the issue I have come across. Here is an example:
[inside a button click event]
fFile = "blah.exe";
sFile = File.Find(_SourceDrive, fFile, true, true, nil, nil);
if (sFile) then
for i, value in sFile do
Paragraph.SetText("Paragraph1", String.AbbreviateFilePath(value, 45));
-- do some more work
end
end
The above code works and displays the search progress in the paragraph object fine. You can see it going though the array and displaying each directory it looked in.
However, as soon as I write a function to handle the same thing and call the function from a button click event for instance, the progress does not display in the paragraph it just shows the fist directory in the array.
[inside button click event]
FindFile(_SourceDrive, "blah.exe");
[global function]
function FindFile(sPath, fFile)
sFile = File.Find(_SourceDrive, fFile, true, true, nil, nil);
if (sFile) then
for i, value in sFile do
Paragraph.SetText("Paragraph1", String.AbbreviateFilePath(value, 45));
-- do some more work
end
end
end
Any ideas why doing the same thing from a function call doesn't allow for the paragraph object to be updated?