Jump to content

Case Process


anixon
 Share

Recommended Posts

This is some code which I have written [an example is support of the question - does not run]:

CODE
While 1

GUICreate($Title, 335, 310, -1, -1)

GUISetBkColor(0xE0FFFF)

GUISetState()

;//User Information

GUISetFont(10, 600, 1, $Font)

GUICtrlCreateGroup(" sSentry Address Book ", 10, 10, 315, 250)

GUISetFont(9, 400, 1, $Font)

;//Skype Name

If $NameToMatch = "" Then $NameToMatch = "Input Skype Name"

GUICtrlCreateLabel("Skype Name:", 25, 37, 100, 25)

$SkypeName = GUICtrlCreateInput($NameToMatch, 125, 35, 165, 20)

GUICtrlSetState(-1, $GUI_FOCUS + $GUI_DROPACCEPTED)

GUICtrlSetLimit(-1, 30)

GUICtrlSetTip(-1, "This is the Callers Skype Name", "Help", 1)

$sSSearch = GUICtrlCreateButton("Search", 10, 270, 75, 25)

GUICtrlSetTip(-1, "Search for the Callers Record", "Help", 1)

;//Exit the Application

$sSExit = GUICtrlCreateButton("Close", 250, 270, 75, 25)

While 1

$msg = GUIGetMsg()

Select

;//Exit the Application

Case $msg = $GUI_EVENT_CLOSE Or $msg = $sSExit

GUIDelete()

Exit

;//Record Search

Case $msg = $sSSearch

GUIDelete()

;Run a Process

ExitLoop

EndSelect

WEnd

WEnd

What is the event command that I can use with the Case $msg = $sSSearch Or ????????????? Statement than will run this process when Input is completed at the $SkypeName Input Box and Enter is Pressed or alternatively the Search button is pressed?. Ant..

Link to comment
Share on other sites

Your code is a little bit messy this time ;)

... kidding ...

Try this:

GUICreate($Title, 335, 310, -1, -1)
GUISetBkColor(0xE0FFFF)
GUISetState() 
;//User Information
GUISetFont(10, 600, 1, $Font)
GUICtrlCreateGroup(" sSentry Address Book ", 10, 10, 315, 250)
GUISetFont(9, 400, 1, $Font)
;//Skype Name
If $NameToMatch = "" Then $NameToMatch = "Input Skype Name"
GUICtrlCreateLabel("Skype Name:", 25, 37, 100, 25)
$SkypeName = GUICtrlCreateInput($NameToMatch, 125, 35, 165, 20)
GUICtrlSetState(-1, $GUI_FOCUS + $GUI_DROPACCEPTED)
GUICtrlSetLimit(-1, 30)
GUICtrlSetTip(-1, "This is the Callers Skype Name", "Help", 1)
$sSSearch = GUICtrlCreateButton("Search", 10, 270, 75, 25)
GUICtrlSetTip(-1, "Search for the Callers Record", "Help", 1)
;//Exit the Application
$sSExit = GUICtrlCreateButton("Close", 250, 270, 75, 25)
While 1 
    $msg = GUIGetMsg() 
    Select
;//Exit the Application
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $sSExit
            Exit 
;//Record Search
        Case $msg = $sSSearch   ;when Search is pressed
            If GUICtrlRead($SkypeName) <> "" Then
                GUIDelete()
                ;Run a Process
            EndIf
        Case $msg = $SkypeName  ;when the inputbox content is modified
            If GUICtrlRead($SkypeName) <> "" Then
                GUIDelete()
                ;Run a Process
            EndIf
    EndSelect
WEnd

You don't need the first While; I guess you don't want this to run endlessly.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Your code is a little bit messy this time ;)

... kidding ...

Try this:

GUICreate($Title, 335, 310, -1, -1)
GUISetBkColor(0xE0FFFF)
GUISetState() 
;//User Information
GUISetFont(10, 600, 1, $Font)
GUICtrlCreateGroup(" sSentry Address Book ", 10, 10, 315, 250)
GUISetFont(9, 400, 1, $Font)
;//Skype Name
If $NameToMatch = "" Then $NameToMatch = "Input Skype Name"
GUICtrlCreateLabel("Skype Name:", 25, 37, 100, 25)
$SkypeName = GUICtrlCreateInput($NameToMatch, 125, 35, 165, 20)
GUICtrlSetState(-1, $GUI_FOCUS + $GUI_DROPACCEPTED)
GUICtrlSetLimit(-1, 30)
GUICtrlSetTip(-1, "This is the Callers Skype Name", "Help", 1)
$sSSearch = GUICtrlCreateButton("Search", 10, 270, 75, 25)
GUICtrlSetTip(-1, "Search for the Callers Record", "Help", 1)
;//Exit the Application
$sSExit = GUICtrlCreateButton("Close", 250, 270, 75, 25)
While 1 
    $msg = GUIGetMsg() 
    Select
;//Exit the Application
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $sSExit
            Exit 
;//Record Search
        Case $msg = $sSSearch   ;when Search is pressed
            If GUICtrlRead($SkypeName) <> "" Then
                GUIDelete()
                ;Run a Process
            EndIf
        Case $msg = $SkypeName  ;when the inputbox content is modified
            If GUICtrlRead($SkypeName) <> "" Then
                GUIDelete()
                ;Run a Process
            EndIf
    EndSelect
WEnd

You don't need the first While; I guess you don't want this to run endlessly.

Hi enaiman its been a while good to hear from you. How's Hobart Town cold enough for you today what was it 10c probably snowed on Mt Wellington better you than me...... ha ha

If you didn't know it it takes an extraordinary effort to write messy code [hours and hours no less] and I have got plenty of practice. In fact I am trying to refine it into an Art form.

Then you come along with a solution which I simply did not see I just hate it when I cannot see the woods for the trees makes me feel code deficient.

Once again I thank you for your prompt and informative response Cheers....... Ant.. :D

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