PDA

View Full Version : Bing where are you?


Bruce
06-14-2009, 08:57 PM
I have a button called bing, it is set to disabled. I also have a text file in a folder called bing.txt. If this text file has nothing in it I don't want to do anything but if it does, then I want to set it to enabled.

Do you see anything wrong with this code?


result = TextFile.ReadToString("AutoPlay\\Docs\\websites\\bing.txt");
nError = Application.GetLastError();
if (nError ~= 0) then
else
Button.SetEnabled("bing", true);
end

Bruce
06-14-2009, 09:54 PM
I just used this code:

size = File.GetSize("AutoPlay\\Docs\\websites\\bing.txt");
if (size>0) then
Button.SetEnabled("bing", true);
else
end

mwreyf1
06-14-2009, 10:04 PM
Really no need to use the "else"

if File.GetSize("AutoPlay\\Docs\\websites\\bing.txt") > 0 then
Button.SetEnabled("bing", true);
end

Bruce
06-14-2009, 10:07 PM
Good point, Thx