Hey everyone!
Is there a command to handle a variable contents using a similar C command to Switch
Something like that:
switch(%A_ThisMenuItem%)
{
case 'option 1':
do something ...
break;
case 'option 2':
do something ...
break;
case 'option 3':
do something ...
break;
}
thanks
similar to Switch in C
Started by
Azevedo
, May 20 2012 04:54 PM
7 replies to this topic
#1
Posted 20 May 2012 - 04:54 PM
#2
Posted 20 May 2012 - 05:26 PM
Like this?
switch("blah")
switch("test")
return
switch(param)
{
if param = test
{
msgbox % param ": do this"
return
}
else if param = test2
{
msgbox % param ": do this"
return
}
else
msgbox % param ": do this"
return
}
#3
Posted 20 May 2012 - 05:39 PM
Yeah but I'm looking for a built in, not a user created.
#4
Posted 20 May 2012 - 05:42 PM
I don't understand what you want, maybe someone else can help.
#5
Guests
Posted 20 May 2012 - 05:54 PM
@Azevedo: there is no switch / case command in ahk. So you do have to build your own.
Search the forum, suggestion section, for case switch and you'll find a number of discussions.
It probably won't be added anytime soon.
Search the forum, suggestion section, for case switch and you'll find a number of discussions.
It probably won't be added anytime soon.
#6
Posted 20 May 2012 - 09:19 PM
I wrote this workaround 100 years ago...
Switch-Case.ahi
...or...(it's also included in Base.ahi)...
Base.ahi
...& yes, I know it's a "workaround", but it's the best I could do, since AutoHotkey does not have it built-in.
Switch-Case.ahi
...or...(it's also included in Base.ahi)...
Base.ahi
...& yes, I know it's a "workaround", but it's the best I could do, since AutoHotkey does not have it built-in.
#7
Posted 20 May 2012 - 11:09 PM
ok. thank you all!
#8
Posted 22 May 2012 - 04:41 PM
Just a thought here. What about using the switch statement in js via com?
<!-- m -->http://www.w3schools...s/js_switch.asp<!-- m -->
Let me know if you need help with it..
<!-- m -->http://www.w3schools...s/js_switch.asp<!-- m -->
Let me know if you need help with it..




