Jump to content

Syntax problem


Lempke
 Share

Recommended Posts

This doesn't work and I don't know why.

Select
    Case $Location = "AAA"
        $LocCode = 1 
    Case $Location = "BBB"
        $LocCode = 2 
    Case $Location = "CCC"
        $LocCode = 3 
    Case $Location = "DD1" Or "DD2" Or "DD3"
        $LocCode = 4
    Case $Location = "EEE"
        $LocCode = 5 
EndSelect
IniWrite("C:\test.ini", "USERDATA", "LocCode", $LocCode)

When the value is EEE is still returns my with code 4 :lmao:

Link to comment
Share on other sites

Select
    Case $Location = "AAA"
        $LocCode = 1 
    Case $Location = "BBB"
        $LocCode = 2 
    Case $Location = "CCC"
        $LocCode = 3 
    Case $Location = "DD1" Or $Location = "DD2" Or $Location = "DD3"
        $LocCode = 4
    Case $Location = "EEE"
        $LocCode = 5 
EndSelect
IniWrite("C:\test.ini", "USERDATA", "LocCode", $LocCode)
oÝ÷ Úî±ä°×!jëh×6
Switch $Location
    Case "AAA"
        $LocCode = 1 
    Case "BBB"
        $LocCode = 2 
    Case "CCC"
        $LocCode = 3 
    Case "DD1", "DD2", "DD3"
        $LocCode = 4
    Case "EEE"
        $LocCode = 5 
EndSwitch
IniWrite("C:\test.ini", "USERDATA", "LocCode", $LocCode)

:lmao:

Link to comment
Share on other sites

or use Switch

Switch $Location
    Case "AAA"
        $LocCode = 1 
    Case "BBB"
        $LocCode = 2 
    Case "CCC"
        $LocCode = 3 
    Case "DD1", "DD2", "DD3"
        $LocCode = 4
    Case "EEE"
        $LocCode = 5 
EndSwitch
IniWrite("C:\test.ini", "USERDATA", "LocCode", $LocCode)

:lmao:

Switch didn't know that one. I have to add a lot more locations, so I'm gonna look into that one.

Thx Mhz

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...