Demokos wrote:
For the JSlover "solution", I think it's, as we say in our beautifull country...(a plaster on a wooden leg) (Sorry JSLover, absolutely no offense !!!)
...I didn't post it as a "solution"...as if I didn't want a real syntax...I want a real syntax (like C)...I just posted that cuz it works...
Demokos wrote:
I can't see how...can be more readable than...
...between those 2, I like my workaround better...but C syntax is more like...
Code:
switch(msg){
case WM_CLOSE:
msgbox, no!
break
case WM_QUIT:
msgbox, still, no!
break
case WM_PAINT:
msgbox, you! paint yourself! I'm not doing it.
break
default:
msgbox, give up eh?
break
}
...C syntax don't cover anything but "equals"...but..."Case = Something"...is ambiguous...are you assigning the Case variable or using it in a Switch-Case?
Possible syntax?...
Code:
switch(msg){
case in WM_CLOSE,WM_QUIT: ;take matchlist as an expression?
msgbox, no!
break
case in "WM_CLOSE,WM_QUIT": ;make matchlist a string match?
msgbox, no!
break
case in "WM_CLOSE","WM_QUIT": ;or this way?
msgbox, no!
break
case contains "Hi": ;contains operator
msgbox, Hi!
break
case [<operator-word>] "Hi": ;<operator-word> is optional
msgbox, Hi!
break
case "Hi": ;default operator is =
msgbox, Hi!
break
case between 1,10: ;less "wordy" between operator...
msgbox, Hi!
break
case between anvil,hammer: ;...with variables
msgbox, Hi!
break
case <operator-word> "Hi": ;expand with more <operator-word>s
msgbox, Hi!
break
}
PhiLho wrote:
...there is no real need for the colons...
...a case isn't a case without a colon (plus how else can it *hit?)...loooooool....
PhiLho wrote:
There is no break...
...there is no Switch-Case syntax yet, how can you say there is no break?...Chris has already said he likes break...or at least wants to do it that way...I like the cases being able to fall thru...you can Gosub if what you are doing requires a loop/break...or the inner break could just automatically break the loop & not the case.
_________________
AutoHotkey-Hotstring.ahk - Helping the world spell "AutoHotkey" correctly! (btw, it's a lowercase k!)