Jump to content

Exception for case


Recommended Posts

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 by Rigest
Link to comment
Share on other sites

But don't you have the problem that the input 1551 will activate both cases?

Why don't you try it? :blink:

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

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 by Rigest
Link to comment
Share on other sites

  • Moderators

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. :blink:

M23

Edit: I see omikron48 is up early as well!

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Below is the amazing code as you call it ;)

Select 
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 :P

Edit 2: Yeah, it's working now. Tnx guys :blink:!

Edited by Rigest
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...