🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5161

Re: Another delphi translation please!

#5161
From: Bruce Knowles
Date: Tue, 27 Sep 2005 12:16
62 lines
2620 bytes
HI ScOe,

I have mulled over your remark for a bit, and wonder about the following.

I think the term RomCode[i] is in fact not generating the address as I 
initially intended.

In fact, the address could be in fact an offset relative to the start 
address supplied in the calling mechanism.

To be precise here, I think the address generated is original offset +  (i * 
sizeof(TxROMCode)); The intention is to address the individual bytes of the 
TxROMCode structure.

As a result your solution of  *RomCode[i] is also probably not the correct 
solution.

Two ways to address this that occur to me are:

val = ((char *)RomCode) [i] & (1 << (b %8));

or

val =  (Romcode + i) & (1 << b % 8));

The other manipulation routines should also be amended in a similar fashion.

Maybe you should try this ??

Regards



Bruce

"ScOe" <__cbinders@hotmail.com__> wrote in message 
news:4338f3fe$1@newsgroups.borland.com...
>> Andrue Cope's query of my posting triggered a recognition of an error 
>> that
> I
>> had made in the code previously supplied. Herewith an updated version of
>> that code that should now suffice.
>>
>> Thanks to Andrue Cope for his observation.
>>
>> Regards
>>
>> Bruce Knowles
>
> Ok, this seems to be correct accept few minor mistakes.
>
>>
>>         // Get the Sernumbit
>>         val = RomCode[i] & (1 << (b % 8));
>>
> i think this one should be *RomCode[i], because on call like you wrote i 
> get
> illegal use of pointer error.
>
> Thank you all for your help!
>
> 
Technical Details
Message-ID: <433937cc@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <43370a81@newsgroups.borland.com> <4337b0dd$1@newsgroups.borland.com> <4337e343@newsgroups.borland.com> <4337fdd8@newsgroups.borland.com> <4338f3fe$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6ea8b2c4d2578842
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bruce Knowles" <knowle_b@mtn.co.za>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <43370a81@newsgroups.borland.com> <4337b0dd$1@newsgroups.borland.com> <4337e343@newsgroups.borland.com> <4337fdd8@newsgroups.borland.com> <4338f3fe$1@newsgroups.borland.com>
Subject: Re: Another delphi translation please!
Date: Tue, 27 Sep 2005 14:16:34 +0200
Lines: 64
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 196.11.239.43
Message-ID: <433937cc@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1127823308 196.11.239.43 (27 Sep 2005 05:15:08 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail