asgarcymed Posted October 1, 2007 Posted October 1, 2007 For example, I tried: CODE (...) Case $var = "pdf" Or $var = "chm" Or $var = "pdb" Or $var = "djvu" Or $var = "rgo" FileMove ($path & "\", path & "\eBooks-eArticles\", 8) (...) And I got the results I expected. Next I tried: CODE (...) Case $var = ("pdf" Or "chm" Or "pdb" Or "djvu" Or "rgo") FileMove ($path & "\", path & "\eBooks-eArticles\", 8) (...) But the results were bad... So I ask - How to do in order not to repeat $var= ? I have about 30 rules ($var = ) - I am coding a file sorter/organizer... MLMK - my blogging craziness...
Nahuel Posted October 1, 2007 Posted October 1, 2007 (edited) True $var="dad" Switch $var Case "mom", "dad", "sister" MsgBox(0,"","Var is mom, dad or sister") EndSwitch False $var="brother" Switch $var Case "mom", "dad", "sister" MsgBox(0,"","Var is mom, dad or sister") EndSwitch LIke that? Edited October 1, 2007 by Nahuel
PsaltyDS Posted October 1, 2007 Posted October 1, 2007 $var="dad" Switch $var Case "mom", "dad", "sister" MsgBox(0,"","Var is mom, dad or sister") EndSwitch Nice example. Note that only works with Switch/Case/EndSwitch, not with Select/Case/EndSelect. OP doesn't actually say which he's using. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Nahuel Posted October 1, 2007 Posted October 1, 2007 Nice example. Note that only works with Switch/Case/EndSwitch, not with Select/Case/EndSelect. OP doesn't actually say which he's using. OP? And yeah, but they both do the same.. so there's no problem changing... right?
PsaltyDS Posted October 1, 2007 Posted October 1, 2007 OP? And yeah, but they both do the same.. so there's no problem changing... right? OP = "Original Post"I didn't try it, but I don't think that syntax works with Select as it does with Switch. Did you do it? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
asgarcymed Posted October 1, 2007 Author Posted October 1, 2007 This works - thank you!! I tested with "strings" (NOT 1, 2, 3.... numbers) Best regards. MLMK - my blogging craziness...
Nahuel Posted October 1, 2007 Posted October 1, 2007 ==> Illegal text at the end of statement (one statement per line).: Select $var What I meant was that they both do the same, but they have a different syntax. So moving from select to switch shouldn't be a big problem
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now