Announcement

Collapse
No announcement yet.

Multiple "if" syntax from the same INI file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple "if" syntax from the same INI file

    Hi Forum, I'm using this code and works fine, but I would some appropriate syntax to do this "elegant way"

    Code:
    Check01 = INIFile.GetValue(_WindowsFolder.."\\My Settings.ini", "My Section", "My Value");
    if Check01=="01" then
    Application.Exit(0);
    
    Check02 = INIFile.GetValue(_WindowsFolder.."\\My Settings.ini", "My Section", "My Value");
    if Check02=="02" then
    Application.Sleep(10000);
    
    Check03 = INIFile.GetValue(_WindowsFolder.."\\My Settings.ini", "My Section", "My Value");
    if Check03=="03" then
    Window.Minimize(Application.GetWndHandle());
    Thanks!

  • #2
    Hi AndrewX try

    Code:
    Check = INIFile.GetValue(_WindowsFolder.."\\My Settings.ini", "My Section", "My Value");
    
    if Check=="01" then --check 1
    Application.Exit(0);
    
    elseif Check=="02" then--check 2
    Application.Sleep(10000);
    
    elseif Check=="03" then--check 3
    Window.Minimize(Application.GetWndHandle());
    
    else
    
    -- None of the conditions met
    Dialog.Message("Notice", "Ini file value invalid", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    
    end

    Comment


    • #3
      Thanks a lot charliechaps, this is what I'm searching for.

      Comment

      Working...
      X