[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

atoi ()

Posted on 2000-01-04
6
Medium Priority
?
1,758 Views
Last Modified: 2012-08-13
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!!!
0
Comment
Question by:packratt_jk
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:wylliker
ID: 2324006
Use the CInt() function.

For example:

Dim A As Integer
Dim SSN As String

SSN = "177475884"

A = CInt("1234")

B = CInt(SSN)
0
 
LVL 3

Author Comment

by:packratt_jk
ID: 2324075
sorry - also need the reverse

itoa()
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2324158
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()
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 3

Author Comment

by:packratt_jk
ID: 2326347
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)
0
 
LVL 4

Accepted Solution

by:
wylliker earned 800 total points
ID: 2326585
WOW, talk about changing your question as you go along ...


Use the Chr() function to return the character for a given integer.

Use the Asc() function to return a integer for a given character.

Chr(65) returns 'A'
Asc('A') returns 65
0
 
LVL 3

Author Comment

by:packratt_jk
ID: 2326627
Perfect!!!

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

Thanks
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

611 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