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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can i parse an int from a string?

Status
Not open for further replies.

adi316

Programmer
Sep 10, 2002
35
0
0
CA
if so can u tell me the procedure?
 
Use Cint() :
Code:
dim str as string
dim i as integer

str="1234"
i = Cint(str)
[code]
 Water is not bad as long as it stays out human body ;-)
 
However, that will round the value if it has a decimal value.

?CInt("1.5") will return 2

Use instead:
i=Int("1.5")

which will return 1

This only works for most decimal numbers.
[/b][/i][/u][sub]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top