Sign in to follow this  
Followers 0
Rigest

Exception for case

9 posts in this topic

#1 ·  Posted (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 by Rigest

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

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

Haha sorry I doubted you, tnx mate!

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by Rigest

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (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. :blink:

M23

Edit: I see omikron48 is up early as well!

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0