asgarcymed 0 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... Share this post Link to post Share on other sites
Nahuel 1 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 Share this post Link to post Share on other sites
PsaltyDS 41 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 Share this post Link to post Share on other sites
Nahuel 1 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? Share this post Link to post Share on other sites
PsaltyDS 41 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 Share this post Link to post Share on other sites
asgarcymed 0 Posted October 1, 2007 This works - thank you!! I tested with "strings" (NOT 1, 2, 3.... numbers) Best regards. MLMK - my blogging craziness... Share this post Link to post Share on other sites
Nahuel 1 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 Share this post Link to post Share on other sites