| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Mon Oct 22, 2007 4:15 am Post subject: Convert a string to an integer |
|
|
I have a program that uses ControlGetText to get a string from a program. This string is just a number, and I would like to know if it is possible to convert this string to an integer. (string to int).
%string%="23"
Does anyone know how to convert this to an integer that can be used in formulas? Thanks! And sorry about the lack of code -- This is a program I am using at work.
Drarum |
|
| Back to top |
|
 |
Jayman
Joined: 21 Oct 2007 Posts: 15
|
Posted: Mon Oct 22, 2007 5:18 am Post subject: |
|
|
I "Think" its...
var := string |
|
| Back to top |
|
 |
YMP
Joined: 23 Dec 2006 Posts: 266 Location: Russia
|
Posted: Mon Oct 22, 2007 9:57 am Post subject: |
|
|
| There's usually no need for any conversion. AutoHotkey will convert it for you automatically. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6063
|
Posted: Mon Oct 22, 2007 10:07 am Post subject: |
|
|
As YMP said... In case you want to remove the leading spaces / zeroes you may += 0 it like follows:
| Code: | Str := " 000212"
Str += 0
MsgBox, % Str |
 |
|
| Back to top |
|
 |
|