Article View: borland.public.cppbuilder.database.ado
Article #1634Re: Use of AnsiString Functions
From: Mark Guerrieri
Date: Fri, 11 Jun 2004 21:48
Date: Fri, 11 Jun 2004 21:48
40 lines
1911 bytes
1911 bytes
AnsiString has 2 member functions defined for it- ToInt() and ToIntDef().
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int i1 = Edit1->Text.ToInt();
int i2 = Edit2->Text.ToInt();
ShowMessage(IntToStr(i1 + i2));
}
Mark
"Daryl" <developeracc@hotmail.com> wrote in message
news:40c77c91@newsgroups.borland.com...
> Scott
>
> > I am having trouble using the following AnsiString function in a
program.
> > The program needs to take input from an input box (by default the type
is
> > AnsiString), and then somehow convert this to an integer.
>
> Try
>
> >> Extract from help>>
> This example uses two edit boxes and a button on a form. When the user
> clicks the button, the code converts the values in the edit boxes to
> numbers, adds them, and displays a message indicating the sum:
>
> void __fastcall TForm1::Button1Click(TObject *Sender)
>
> {
> int i1, i2;
> i1 = StrToInt(Edit1->Text);
> i2 = StrToInt(Edit2->Text);
> ShowMessage(IntToStr(i1 + i2));
> >>>>>
>
> Daryl
>
>
Technical Details
Message-ID:
<40ca2897$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40c77309$1@newsgroups.borland.com> <40c77c91@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,e7d2b3b3ff7cb04b X-Google-Attributes: gid10698b,public From: "Mark Guerrieri" <markg11@comcast.net> Newsgroups: borland.public.cppbuilder.database.ado References: <40c77309$1@newsgroups.borland.com> <40c77c91@newsgroups.borland.com> Subject: Re: Use of AnsiString Functions Date: Fri, 11 Jun 2004 17:48:12 -0400 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-Mimeole: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.39.161.71 Message-ID: <40ca2897$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1086990487 68.39.161.71 (11 Jun 2004 14:48:07 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail