Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

what does this code do? Int(txtTEst.Text)

Posted on 2010-09-14
6
Medium Priority
?
366 Views
Last Modified: 2012-05-10
what does this code do? Int(txtTEst.Text).  txtest is a textbox.
0
Comment
Question by:troyvw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:Vipul Patel
ID: 33675497
Gives below error
"The name 'Int' does not exist in the current context"
because .net compiler searches method Int(string data).
If it does not exist then gives error else calls implemented method.
0
 
LVL 17

Accepted Solution

by:
Zhaolai earned 2000 total points
ID: 33675540
It should be CInt(txtTEst.Text), which converts the text in the textbox to an integer.
0
 

Author Closing Comment

by:troyvw
ID: 33675550
ty
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 17

Expert Comment

by:Zhaolai
ID: 33675608
Remember to check the textbox's text before converting, otherwise it will throw an error.
Like this:

Dim iValue as Integer
If IsNumeric(txtTEst.Text) then
    iValue = CInt(txtTEst.Text)
End If

0
 

Author Comment

by:troyvw
ID: 33675643
What if i wanted it to retain the decimal? for example if i entered 1.3
0
 
LVL 17

Expert Comment

by:Zhaolai
ID: 33675718
Then use CDbl to convert to double, or CSng to convert to single, or CDec to convert to decimal. All of them will retain the decimal.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question