Thread View: borland.public.cppbuilder.migration
3 messages
3 total messages
Started by Cooper
Wed, 21 Dec 2005 21:02
Very little Visual Fox Pro code to BCB. Need Help...
Author: Cooper
Date: Wed, 21 Dec 2005 21:02
Date: Wed, 21 Dec 2005 21:02
36 lines
1468 bytes
1468 bytes
Dear All,
I need to convert a piece of Visual Fox Pro code to BCB.Is it
possible to help me to convert this simple code please? I tried
to convert like this :
FUNCTION YY
LPARAMETERS akyt
LOCAL ly, li
ly = 0
FOR li = 1 TO LEN(akyt)
ly = ly + ASC(SUBSTR(akyt, li, 1)) * 2 ^ li
ENDFOR
RETURN lyetkikodu
ENDFUNC
AnsiString __fastcall TForm1::YY(TObject *, AnsiString akyt)
{
int ly,li;
ly = 0;
for (li = 1;li<akyt.Length()-1;li++)
{
ly += pow(((StrToInt(akyt[li])+48) * 2),li) ;
}
return IntToStr(ly);
}
But it does not give the same result... So what is wrong with
this code??
Thanks in advance...
Cooper
Re: Very little Visual Fox Pro code to BCB. Need Help...
Author: Remy Lebeau (TeamB)
Date: Wed, 21 Dec 2005 23:07
Date: Wed, 21 Dec 2005 23:07
19 lines
1381 bytes
1381 bytes
"Cooper" <Cooper@cooper.com> wrote in message
news:43a9d0db$1@newsgroups.borland.com...
> I need to convert a piece of Visual Fox Pro code to BCB.Is it
> possible to help me to convert this simple code please?
Try this:
int __fastcall YY(const AnsiString &akyt)
{
int ly = 0;
for(int li = 1; li <= akyt.Length(); ++li)
ly += (akyt[li] * (1 << li));
return ly;
}
Gambit
Re: Very little Visual Fox Pro code to BCB. Need Help...
Author: Cooper
Date: Thu, 22 Dec 2005 06:52
Date: Thu, 22 Dec 2005 06:52
27 lines
1562 bytes
1562 bytes
"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
>"Cooper" <Cooper@cooper.com> wrote in message
>news:43a9d0db$1@newsgroups.borland.com...
>
>> I need to convert a piece of Visual Fox Pro code to BCB.Is it
>> possible to help me to convert this simple code please?
>
>Try this:
>
> int __fastcall YY(const AnsiString &akyt)
> {
> int ly = 0;
> for(int li = 1; li <= akyt.Length(); ++li)
> ly += (akyt[li] * (1 << li));
> return ly;
> }
>
>
>Gambit
>
>
Thank you it worked perfectly... BTW i wonder, when will i
learn this c++? :(
Cooper
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads