Jump to content

Ini Read error


J0ker
 Share

Recommended Posts

Hi,

I have an ini file to store all infos used in my script. I want to check if all infos were right filled at beginning of my script.

Global $Statement = IniRead(@SCRIPTDIR & "\Config.ini", "This", "House", 0)

;Make sure that all settings are OK
    
    If $Statement <> "House" <> "Building" <> "Bungalow" Then
        MsgBox(0,"Error","Statement Error, Make sure to write the right infos in the Config.ini file")
        Sleep(50)
        Exit
    EndIf

It's only working for the word House because its the first after the If but for the other words, it's not working. What should I change to this code? The problem dont come from the Ini Read, but from the If statement.

Link to comment
Share on other sites

If $Statement <> "House" And $Statement <> "Building" And $Statement <> "Bungalow" Then

Thanks! :)

Is this can be simplified?

Global $Level = IniRead(@SCRIPTDIR & "\Config.ini", "Level", "Level", 0)

If $Level > 29 then
        MsgBox(0,"Error","Level Error ")
        Sleep(50)
        Exit
    EndIf
    
    If $Level < 0 then
        MsgBox(0,"Error","Level Error ")
        Sleep(50)
        Exit
    EndIf
Edited by J0ker
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...