[futurebasic] Arrays/Handles/Records/Easy

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 1998 : Group Archive : Group : All Groups

From: tatewake@... (TJ Grant)
Date:
Ok; here's my situation:
DIM RECORD Vertex2D
  DIM vertex2dX&
  DIM vertex2dY&
DIM END RECORD.Vertex2D

DIM RECORD Shape2D
  DIM shape2dCOLOR&
  DIM shape2dnumOfVertices&
  DIM vertex2dptr&
DIM END RECORD.Shape2D


DIM triangleVertexArray.Vertex2D(2)
DIM triangleShape.Shape2D
triangleVertexArray.vertex2dX&(0) = 100
triangleVertexArray.vertex2dY&(0) = 280
triangleVertexArray.vertex2dX&(1) = 400
triangleVertexArray.vertex2dY&(1) = 280
triangleVertexArray.vertex2dX&(2) = 250
triangleVertexArray.vertex2dY&(2) = 30

triangleShape.shape2dCOLOR& = 255
triangleShape.shape2dnumofVertices& = 3

Ok, everything's cool so far.

'From here on down is the problem.
triangleShape.vertex2dptr& = @triangleVertexArray.Vertex2D(0)

DIM tmp9.Vertex2D(2)
tmp9.Vertex2D(0) = triangleShape.vertex2dptr&

Ok, here's where I have the questions; I've tried multiple things to try to
get the tmp9.Vertex2D record array to equal the same thing as in the
triangleVertexArray.Vertex2D record.

Why I would even need to do this in the first place is because FB2 doesn't
support arrays inside of a record, and the three lines above would be in
it's own FN, where I would pass a Shape2D record, and nicely pull out the
other record based on the vertexptr&.

It's based on some 2d/3d C code I'm trying to port(which looks fairly
simple to port once I can figure out how to do record stuff above).

Any quick help would very appreciated, because I'm willing to share my
ported code with the list as soon as it's finished.
(See ftp://ftp.foxchange.com/pub/inspired/Scube.hqx for an example of
something I've already ported nicely.)



~ Windows 98.  Microsoft has been informed of this
   problem and has labeled it a "will not fix". ~

-- TJ Grant (tatewake@...)
Inspired Software. http://inspired.netstreet.net/
Macintosh, Dos, Windows, and BeOS software solutions.
Phone: 407-728-7563