Thanks Maarten and Moz for your help!!!

This is what I wrote last time:

-o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o-
I am still struggling with pointers and indexing them.   The
current code I am trying to convert is contained in
some nested FOR loops:

===============================================================
A_RecordPtr: ^SomeRecordType;
i:           uint32;
j:           uint32;
pAuthDB:     ^SomeOtherRecordType;


if
(A_RecordPtr[i].SomeBoolFunc(TransposeByteOrder(*(uint32*)&pAuthDB[j].DBID)))
===============================================================

How can I handle this without getting the dreaded 
"Array Type Required" error?
-o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o-

      However, it's not just a RECORD that I am trying to 
      operate on.  Rather, there's a CLASS too.  I should have 
      written:

-o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o-
I am still struggling with pointers to classes and records
(and how to index them).   The current code I am trying to 
convert is contained in some nested FOR loops:

===============================================================
A_ClassPtr:  ^SomeClassType;
i:           uint32;
j:           uint32;
pAuthDB:     ^SomeRecordType;


if
(A_ClassPtr[i].SomeBoolFunc(TransposeByteOrder(*(uint32*)&pAuthDB[j].DBID)))
===============================================================

How can I handle this without getting the dreaded 
"Array Type Required" error?
-o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o--o-

Maarten Wiltink wrote:
> By using enough temporary variables, mostly. You should by now have
> seen all the errors before and know how to solve any of them. 

I wish.  With all the pointers, records, classes & indexes, the 
levels of abstraction are almost too much for my brain to handle!


> All
> that can go wrong now is that you don't spot what exactly is wrong;
> the solution to that is to split up the code until you can only make
> one mistake at a time.

This makes perfect sense.  I just wish I could get a handle on
all the indexing pointers to records/classes.  Then I could 
split off the other stuff into temporary variables, etc.

> 
> Groetjes,
> Maarten Wiltink


At 15:55 4/4/2005, Moz, wrote:
>By declaring a type foo:array of SomeRecordType, and assigning the
>start of the array to it. 

Which 'it'?  Would that mean something like:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Type
  SomeRecTypeAry: Array of SomeRecordType;

@SomeRecTypeAry := pAuthDB;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>C treats pointers and arrays as identical,
>but Pascal doesn't (it's more strongly typed as well as less case
>sensitive).
>
>Moz

Thanks again guys for your valuable advice.  If you would
be so kind, please *point* me in the right direction
once more!




Start Here to Find It Fast!� -> http://www.US-Webmasters.com/best-start-page/
$8.77 Domain Names -> http://domains.us-webmasters.com/


__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to