473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Should be a really easy if statement

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.
Mar 8 '08 #1
6 1070
Correction. evaluate the CONTENTS of a textbox, not context.

"Jonathan Brown" wrote:
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.
Mar 8 '08 #2
On Mar 8, 10:56*pm, Jonathan Brown
<JonathanBr...@discussions.microsoft.comwrote:
Correction. *evaluate the CONTENTS of a textbox, not context.

"Jonathan Brown" wrote:
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.- Hide quoted text -

- Show quoted text -
Do you mean:

Public YourSub (....)

If me.txtbox.text.contains("whatsoever") = True Then

Exit Sub

Else

' ...Code

End if

End Sub
Mar 8 '08 #3
On Mar 8, 11:07*pm, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On Mar 8, 10:56*pm, Jonathan Brown

<JonathanBr...@discussions.microsoft.comwrote:
Correction. *evaluate the CONTENTS of a textbox, not context.
"Jonathan Brown" wrote:
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.- Hide quoted text -
- Show quoted text -

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

* Exit Sub

Else

' ...Code

End if

End Sub- Hide quoted text -

- Show quoted text -


Mar 8 '08 #4
perfect!!! thank you. That's exactly what I needed. I knew it was something
simple.

"kimiraikkonen" wrote:
On Mar 8, 11:07 pm, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On Mar 8, 10:56 pm, Jonathan Brown

<JonathanBr...@discussions.microsoft.comwrote:
Correction. evaluate the CONTENTS of a textbox, not context.
"Jonathan Brown" wrote:
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.- Hide quoted text -
- Show quoted text -
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

Exit Sub

Else

' ...Code

End if

End Sub- Hide quoted text -

- Show quoted text -

Mar 8 '08 #5
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
"Jonathan Brown" <Jo***********@discussions.microsoft.comschreef in
bericht news:4B**********************************@microsof t.com...
>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.
Mar 9 '08 #6
I'm going to suggest INSTR, merely because it is actually BASIC.

--
David Streeter
Synchrotech Software
Sydney Australia
"Jonathan Brown" wrote:
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.
Mar 10 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Christopher J. Bottaro | last post by:
This post is just the culmination of my thoughts and discussions with my coworkers on Python. If you are not interested, please skip over it. At my work, we are developing a product from...
17
by: SUMIT | last post by:
I wrote a program for removing comment from C source file for which i... 1.first constructed a DFA 2.used goto statement to write a program. now it was very easy to model DFA using goto & i...
102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
3
by: D. Shane Fowlkes | last post by:
Sorry for the length of this post. I have created a rather complex form which has a header/line item (parent and child records) structure. It's for an intranet. A screenshot can be seen here: ...
2
by: David Beaven | last post by:
I am creating an aspx page to show (i.e. read only) hundreds or probably thousands of items from two database queries. The user may of course only want to read one or two pages worth. I have (I...
5
by: Stefano Peduzzi | last post by:
Hi, I'm building an application where I've defined a custom class Customer. Customer can have many phones (defined by phoneType and phoneNumber). I want to check that a phoneNumber is not already...
33
by: mscava | last post by:
Well I've got a problem, that is more theoretical than practital. I need to know benefits of RTTI. I see another way of doing it... class A { public: ~virtual A() {} enum Type { X, Y, Z }; ...
28
by: windandwaves | last post by:
Can someone tell me why I should learn python? I am a webdeveloper, but I often see Python mentioned and I am curious to find out what I am missing out on. Thank you Nicolaas
16
by: Raxit | last post by:
Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? what can i do easily with python which is not easy...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.