I have an input box in my program and I want to be able to control the flow when the 'cancel' button is pushed. Any help would be appreciated.

retval = inputbox("type stuff")
if retval = "" then 
    ' /* Cancel Pushed, Or Left Blank */
    msgbox "You Entered Nothing..."
else
    ' /* They Typed Stuff */
    msgbox retval
end if
retval = inputbox("type stuff")
if retval = "" then 
    ' /* Cancel Pushed, Or Left Blank */
    msgbox "You Entered Nothing..."
else
    ' /* They Typed Stuff */
    msgbox retval
end if

The message box has two buttons - 'OK' and 'Cancel'. How do I access the flow from the 'Cancel' button. Thanks

The message box has two buttons - 'OK' and 'Cancel'. How do I access the flow from the 'Cancel' button. Thanks

Guess I need to be told twice. Thanks!

Get the return value from the msgbox call. It returns the button value pressed.

In the code I posted, retval (the variable) will be blank if the user pressed cancel. Hence the code:

if retval = "" then 
    ' /* Cancel Pushed, Or Left Blank */
    msgbox "You Entered Nothing..."

how can i change inputbox default button, OK and CANCEL to

YES, NO and CANCEL????


cAn yOu hElp mE guyZ.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.