Jump to content
Sign in to follow this  
Lempke

Syntax problem

Recommended Posts

Lempke

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:

Share this post


Link to post
Share on other sites
MHz

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:

Share this post


Link to post
Share on other sites
Lempke

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

Share this post


Link to post
Share on other sites
Lempke

Is this in the manual ??

Can't find Switch or EndSwitch???

Edited by Lempke

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.