🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.migration
Article #30

Very little Visual Fox Pro code to BCB. Need Help...

#30
From: Cooper
Date: Wed, 21 Dec 2005 21:02
36 lines
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
Technical Details
Message-ID: <43a9d0db$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 110f51,5c638784379559d9,start
X-Google-Attributes: gid110f51,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Cooper" <Cooper@cooper.com>
Sender: "Cooper" <Cooper@cooper.com>
Reply-To: "Cooper" <Cooper@cooper.com>
Subject: Very little Visual Fox Pro code to BCB. Need Help...
Newsgroups: borland.public.cppbuilder.migration
X-User-Info: 85.104.224.124     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <43a9d0db$1@newsgroups.borland.com>
Date: 21 Dec 2005 14:02:03 -0700
X-Trace: newsgroups.borland.com 1135202523 207.105.83.66 (21 Dec 2005 14:02:03 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail