Jump to content
Sign in to follow this  

Interesting Inputbox() behaviour

Recommended Posts


Just an FYI, with the following code: hitting "ESC" on the inputbox would generate a $temp with a value of "" and @error with a value of zero....

$temp = InputBox("SSN Entry", "Please enter Social", "", "", -1, -1, @DesktopWidth / 4, @DesktopHeight / 3)
    Case @error = 1
        MyExit (100) ; cancel
    Case @error = 2
        MyExit (200) ; timeout
    Case @error = 3
        MyExit (300) ; faiure
    _cs ($c, "{end}" & $temp & "{numpadenter}")
$temp = waitscreen ($c, "end of matching ssn", 10)
If @error > 0 Or $temp < 1 Then MyExit (400)
oÝ÷ Ø%¹Øv)Ú§]ب©jǬµ«^éí¶^²×è®Ë©Þ½éí¹©b·&®¶­s`¢66Rb33c·FV×ÒgV÷C²gV÷C²æBW'&÷"Ò¢×WBS²77VÖRW66Rv2&W76V@

Is the current return value expected behaviour on the inputbox when "ESC" is pressed?

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post

Link to post
Share on other sites

Your code is unworkable in it's present state.

But this InputBox() does return "Cancel" when "Esc" is pressed.

InputBox("SSN Entry", "Please enter Social", "", "", -1, -1, @DesktopWidth / 4, @DesktopHeight / 3)
Switch @error
    Case 0
        MsgBox(0, '', 'Valid', 3)
    Case 1
        MsgBox(0, '', 'Cancel', 3)
    Case 2
        MsgBox(0, '', 'Timeout', 3)
    Case 3
        MsgBox(0, '', 'Failed to open Inputbox', 3)

Seems fine to me.

Perhaps you are checking ToggleKeys() for @error instead?


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.