Page 1 of 1

Structure Pointer ?

Posted: Mon Nov 13, 2006 9:00 pm
by Comtois
We have structure for Byte, Long, Quad, Float, String, etc
What about a structure for pointer ?

Code: Select all

Structure Pointer
  *p
EndStructure
Why this ?

I have an array of pointer

Code: Select all

Dim *Array(2,2,2)
And i need to copy this array to another array

Code: Select all

Dim *TempArray(2,2,2)
So i have to write

Code: Select all

  CopyMemory(*Array(), *TempArray(), SizeOf(Pointer) * 27)
May be this structure can be add in resident file ? or may be i'm wrong to do like this ?

Posted: Mon Nov 13, 2006 9:29 pm
by Rescator
Hmm!
Maybe you should request CloneArray() and CloneList() instead?
(creates a exact copy/duplicate of a array or list)

In any case, on 32bit systems *pointer is the same as pointer.l
But a future 64bit compiler may be different so...
*scratches head* might be best to let the PB Team answer this one... I suddenly drew a blank here.

Posted: Mon Nov 13, 2006 10:25 pm
by Fluid Byte
Dim *Array1(2,2,2)
Dim *Array2(2,2,2)

*Array2() = *Array1()

:?:

Posted: Mon Nov 13, 2006 11:10 pm
by Comtois
Maybe you should request CloneArray() and CloneList() instead?
(creates a exact copy/duplicate of a array or list)
I dont need this, I can use CopyMemory().
In any case, on 32bit systems *pointer is the same as pointer.l
But a future 64bit compiler may be different so...
Yes it's the reason why i'm asking for something to give the size of a pointer :)

Code: Select all

Dim *Array1(2,2,2)
Dim *Array2(2,2,2)

*Array2() = *Array1()
This code dont work.

I just suggest to add structure pointer in residents, nothing else :)