Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014

    Bing where are you?

    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\\b ing.txt");
    nError = Application.GetLastError();
    if (nError ~= 0) then
    else
    Button.SetEnabled("bing", true);
    end

  2. #2
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    I just used this code:

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

  3. #3
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Really no need to use the "else"

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

  4. #4
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    Good point, Thx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts