|
-
Oct 29th, 2005, 05:56 PM
#1
Thread Starter
Hyperactive Member
Error RESOLVED
I have a InputBox
Code:
StrVar = InputBox("Add A Base Word To The List", "Add Word To list")
If i decide i don't wana add a word and click cancel it errors.
How i stop this ??
Last edited by Ricky1; Oct 29th, 2005 at 06:05 PM.
-
Oct 29th, 2005, 05:58 PM
#2
Re: Error
It doesn't error because of that. What is the next line that it processes, or the line of the error?
-
Oct 29th, 2005, 05:59 PM
#3
Re: Error
If you press Cancel the InputBox returns an empty string so you should check for that.
-
Oct 29th, 2005, 06:00 PM
#4
Thread Starter
Hyperactive Member
Re: Error
lstRoot.AddItem StrVar
is next line.
-
Oct 29th, 2005, 06:01 PM
#5
Thread Starter
Hyperactive Member
Re: Error
do i have to say something like
Code:
if Len(StrVar) = 0 Then Exit Sub
??
-
Oct 29th, 2005, 06:02 PM
#6
Re: Error
I really can't see that you would get an error message, but it would add an empty string to the ListBox.
VB Code:
StrVar = InputBox("Add A Base Word To The List", "Add Word To list")
If Len(StrVar) > 0 Then
lstRoot.AddItem StrVar
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|