Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Without using strings???!!!

Status
Not open for further replies.

khaled99

MIS
Mar 12, 2005
5
US
Hello,

how can i build a new form that receives a text in a textbox and then displays the 5th and 10th characters of that text without using strings.(ex. if I entered in the first textbox 0123456789, after clicking the button it should shows in the other textbox the following numbers 4 9. (i know how to do it using strings, is there a way to do it without using a strings???!!!)

thank you
 
You can display it like:
Code:
Messagebox.Show(Mid(TextBox1.Text, 5, 1) & Mid(TextBox1.Text, 10, 1))
but I don't understand what you mean by "is there a way to do it without using a strings". Retreiving the Text property of the TextBox will return a string anyway, but if you meant by not declaring a variable with a string type then the above will work.

What is your reason for not wanting to use a string?

----------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Textbox.text.Chars(5)
Textbox.text.Chars(10)

Make sure the .Length is >= 10 before pulling the chars though. And as the above poster mentioned, the .text property IS a string.

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
[banghead]
 
Once the value is converted to a numeric variable,

To find the "9", use value mod 10

To find the "4", divide by 100000, then do a mod 10

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top