#### Archived

This topic is now archived and is closed to further replies.

# INT conversion question...

## Recommended Posts

pimple    122
Hi... I'm using Borland C++ Builder 6, and I'm having some problems making a calculator... All goes well until I try to assign the value of my edit box into an integer... here's my code:
int iOne; //my int...

iOne = myWindow->txtOne->Text; // myWindow is my window and txtOne is the name of my edit box... and text is the property i'm trying to assing the value to an int...


when i try to compile that, it says that i can't convert 'AnsiString' into an 'int'. there's a function on the help files that supposedly does that, but it only works for a char *. ex: char *cName; cName = myWindow->txtName->Text.c_str(); // that works, but only with pointers to a character. any ideas? thanks! [edited by - pimple on September 3, 2003 5:58:21 PM]

##### Share on other sites
Alimonster    185
Try StrToInt (or StrToIntDef).

[edited by - Alimonster on September 3, 2003 6:01:22 PM]