A
Alan
How do I know the use click the cancel button on the input box ?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Alan said:How do I know the use click the cancel button on the input box ?
Armin Zingler said:An empty string is returned:
dim s as string
s = inputbox(...)
if s.length = "" then
'cancel pressed or no input
else
'
end if
--
Armin
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
* José Manuel Agüero said:InputBox returns 'Nothing' if the Cancel button is pressed:
dim a as string
a=inputbox("Write something or press Cancel")
if a is nothing then
msgbox("The user pressed Cancel.")
else
'Do something with a.
end if

* José Manuel Agüero said:OK, I mistaked the function. InputBox returns "" if cancelled, but...
String.Length is an Integer, you should write:
If s="" Then
Or
If s.length=0 Then
ACK.
Regards... and sorry for my mistake![]()
José Manuel Agüero said:OK, I mistaked the function. InputBox returns "" if cancelled,
but... String.Length is an Integer, you should write:
If s="" Then
Or
If s.length=0 Then
Regards... and sorry for my mistake![]()
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.