Link to home
Start Free TrialLog in
Avatar of packratt_jk
packratt_jkFlag for United States of America

asked on

atoi ()

I'm looking for a function in vb (access 97) that will do the equivolent
of what the atoi() function does in c / c++

Please help!!!
Avatar of wylliker
wylliker

Use the CInt() function.

For example:

Dim A As Integer
Dim SSN As String

SSN = "177475884"

A = CInt("1234")

B = CInt(SSN)
Avatar of packratt_jk

ASKER

sorry - also need the reverse

itoa()
Use CStr() or Str() to convert numbers to strings.

From VB Help:
"The Str function recognizes only the period (.) as a valid decimal separator. When different decimal separators may be used (for example, in international applications), use CStr to convert a number to a string."

You may also use Val() and Format()
hmmm....

first of all, I only need to convert one character.
I need the ansi / ascii equviolent of the character to be returned
example: the character '2' should translate to 50 (decimal)
ASKER CERTIFIED SOLUTION
Avatar of wylliker
wylliker

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect!!!

sorry I asked the wrong question...
I knew what I meant :)

Thanks