I really need some precise information

How do I make a rule based on if:

1. Cancel button is selected
2. Or if OK is selcted however no input is provided in the InputBox.

I have 2 different events that are to occur depending on which occurs, and
there cannot be any overlap.


I have found that If IsEmpty(variable) can do detect both and so the same
results for both occurs from my statements. I need more finer way of determining
this.

Does anyone have any tips ?

Re: InputBox output detection by ekkehard

ekkehard
Sat Mar 22 04:26:40 CDT 2008

Robbie Flower schrieb:
>
> I really need some precise information
>
> How do I make a rule based on if:
>
> 1. Cancel button is selected
> 2. Or if OK is selcted however no input is provided in the InputBox.
>
> I have 2 different events that are to occur depending on which occurs,
> and there cannot be any overlap.
>
>
> I have found that If IsEmpty(variable) can do detect both and so the
> same results for both occurs from my statements. I need more finer way
> of determining this.
> Does anyone have any tips ?
>
>
Dim sInp : sInp = "?"

sInp = InputBox( "enter something sensible", , sInp )
If IsEmpty( sInp ) Then
WScript.Echo "!Aborted!"
Else
sInp = Trim( sInp )
If "" = sInp Then
WScript.Echo "!Empty input!"
Else
WScript.Echo "you entered", sInp
End If
End If

You'll get "!Aborted!" regardless of the entered content if Cancel
or Close (X) is pressed, but I think that's reasonable.