Rigest Posted July 15, 2010 Share Posted July 15, 2010 (edited) Hi all, I tried to figure out how to make an exception for a case. I have the following Select Case $Brief > "000" Endselect But I want to make an exception if $Brief = 1551. First I tried to search for an function that says If $Brief = "1551" Then blabla and Skip to line 100 (so it would skip beyond the case). But I couldn't find such a function. Then I tried Case $Brief > "000" not if $Brief = "1551", but that gave an error. It probably is something really simple, but I looked into the function list and couldn't find anything that could help me. Any help would be great! Edited July 15, 2010 by Rigest Link to comment Share on other sites More sharing options...
ajag Posted July 15, 2010 Share Posted July 15, 2010 select case $Brief = 5115 ; do nothing case $Brief > 000 MsgBox(0,"XXX","Yeah") EndSelect A-Jay Rule #1: Always do a backup Rule #2: Always do a backup (backup of rule #1) Link to comment Share on other sites More sharing options...
Rigest Posted July 15, 2010 Author Share Posted July 15, 2010 But don't you have the problem that the input 1551 will activate both cases? Link to comment Share on other sites More sharing options...
ajag Posted July 15, 2010 Share Posted July 15, 2010 But don't you have the problem that the input 1551 will activate both cases?Why don't you try it? Or read the helpfile:"If more than one of the Case statements are true, only the first one is executed."A-Jay Rule #1: Always do a backup Rule #2: Always do a backup (backup of rule #1) Link to comment Share on other sites More sharing options...
Rigest Posted July 15, 2010 Author Share Posted July 15, 2010 Why don't you try it? Or read the helpfile:"If more than one of the Case statements are true, only the first one is executed."A-JayHaha sorry I doubted you, tnx mate! Link to comment Share on other sites More sharing options...
Rigest Posted July 17, 2010 Author Share Posted July 17, 2010 (edited) Okay, so I tried the above and it didn't work. The value for $Brief was 1551 and both cases ($Brief = "1551" and $Brief > "0000") were executed... isn't there a way to say skip to line X? Edited July 17, 2010 by Rigest Link to comment Share on other sites More sharing options...
omikron48 Posted July 17, 2010 Share Posted July 17, 2010 Don't know what your problem is, but this code only displays one message box for me. Global $Brief = 1551 select case $Brief = 1551 MsgBox(0,"YYY","Xeah") case $Brief > 000 MsgBox(0,"XXX","Yeah") EndSelect Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 17, 2010 Moderators Share Posted July 17, 2010 (edited) Rigest, The following works fine for me: For $Brief = 5113 To 5117 Select Case $Brief = 5115 MsgBox(0, "Brief", "5115") Case $Brief > 000 MsgBox(0, "Brief", "Another value") EndSelect Next Please post the code that gave you that amazing result. M23 Edit: I see omikron48 is up early as well! Edited July 17, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Rigest Posted July 19, 2010 Author Share Posted July 19, 2010 (edited) Below is the amazing code as you call it expandcollapse popupSelect Case $Brief = "1551" Send ("43 {ENTER}") Sleep (100) Send ("{ENTER}") Sleep (100) Send ("{F5}") Sleep (250) Send ("4 {ENTER}") Sleep (150) Send ("{TAB}") Sleep (100) Send ("INFO{TAB}") Send ("OC1551") Sleep (100) Send ("{ENTER}") Sleep (50) Send ("{ENTER}") Sleep (50) Send ("{ENTER}") EndSelect Select Case $Brief = "1565" Send ("5 {ENTER}") MouseClickDrag ("left", 1041,787, 186,786) Send ("{CTRLDOWN}") Sleep (100) Send ("C") Send ("{CTRLUP}") $1565 = ClipGet() Sleep (200) Send ("1565 {ENTER}") Sleep (100) Send ("{F5}") Sleep (100) Send ("16 {ENTER}") Sleep (100) Send ("{F2}") Sleep (100) Send ("OC1565: {TAB}") Sleep (100) Send ($1565) Endselect Select Case $Brief > "0000" Send ("7 {ENTER}") Send ($Brief) Send ("{ENTER}{ENTER}{F5}") Send ("{ENTER}{F1}") Sleep (50) Send ("4 {ENTER}") Send ("Z") Sleep (50) Send ("INFO {TAB}") Sleep (50) Send ("OC") Send ($Brief) Sleep (100) Send ("{ENTER}") Sleep (50) Send ("{ENTER}") Sleep (50) Send ("{ENTER}") Endselect Edit: Oh wait, I see above that you made the cases in one select/endselect. So I guess that is my problem. Gonna try it right now Edit 2: Yeah, it's working now. Tnx guys ! Edited July 19, 2010 by Rigest Link to comment Share on other sites More sharing options...
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