I need to evaluate the context of a textbox to see if it already contains a
period. if it does then exit sub, else do this code.
If me.txtbox.text contains a period then
exit sub
else
code...
end if
Is there some sort of function for this? Something like a
contains(me.txtbox.text,".")
I hope this makes sense.
Jonathan Brown - 08 Mar 2008 20:56 GMT
Correction. evaluate the CONTENTS of a textbox, not context.
> I need to evaluate the context of a textbox to see if it already contains a
> period. if it does then exit sub, else do this code.
[quoted text clipped - 9 lines]
>
> I hope this makes sense.
kimiraikkonen - 08 Mar 2008 21:07 GMT
On Mar 8, 10:56 pm, Jonathan Brown
<JonathanBr...@discussions.microsoft.com> wrote:
> Correction. evaluate the CONTENTS of a textbox, not context.
>
[quoted text clipped - 13 lines]
>
> - Show quoted text -
Do you mean:
Public YourSub (....)
If me.txtbox.text.contains("whatsoever") = True Then
Exit Sub
Else
' ...Code
End if
End Sub
kimiraikkonen - 08 Mar 2008 21:09 GMT
> On Mar 8, 10:56 pm, Jonathan Brown
>
[quoted text clipped - 18 lines]
>
> Do you mean:
Sorry, correcting:
> Public YourSub (....)
Must be:
Public Sub YourSub(...)
' ...
' The rest is same (below).
> If me.txtbox.text.contains("whatsoever") = True Then
>
[quoted text clipped - 9 lines]
>
> - Show quoted text -
Jonathan Brown - 08 Mar 2008 21:40 GMT
perfect!!! thank you. That's exactly what I needed. I knew it was something
simple.
> > On Mar 8, 10:56 pm, Jonathan Brown
> >
[quoted text clipped - 43 lines]
> >
> > - Show quoted text -
Jack Jackson - 10 Mar 2008 05:39 GMT
>Correction. evaluate the CONTENTS of a textbox, not context.
>
[quoted text clipped - 11 lines]
>>
>> I hope this makes sense.
One way to proceed with this sort of question would be to start
typing:
If me.txtbox.text.
At that point Intellisense will show you what methods are available.
Maybe you can see something that looks like it might do what you want.
Another approach is to realize that me.txtbox.text is a String, and go
look at the properties and methods of the string class. I prefer
Google for this rather than the built-in help. Googling for:
.NET string class
will probably show the MSDN documentation for the String class in the
first few hits.
Cor Ligthert[MVP] - 09 Mar 2008 13:18 GMT
Jonathan,
AFAIK is mostly this used to see if something exist in a string
if MyString.IndexOf(0,".") = -1 then 'there is no dot.
(you can concatinate that and find as well the second dot.
Cor
>I need to evaluate the context of a textbox to see if it already contains a
> period. if it does then exit sub, else do this code.
[quoted text clipped - 9 lines]
>
> I hope this makes sense.
SurturZ - 10 Mar 2008 07:16 GMT
I'm going to suggest INSTR, merely because it is actually BASIC.

Signature
David Streeter
Synchrotech Software
Sydney Australia
> I need to evaluate the context of a textbox to see if it already contains a
> period. if it does then exit sub, else do this code.
[quoted text clipped - 9 lines]
>
> I hope this makes sense.