A
Alan
How do I know the use click the cancel button on the input box ?
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