How to access the 2nd dimension

hung

Active Member
Licensed User
Longtime User
I have declare array as below:

dim type (x, y) shape(1000, 500)
first dimension is points in a polygon shape, e.g. shape(0, 1) to shape(1000,1) , that I use to draw polygon. shape(0, 2) to shape(1000,2) refers to another polygon.

when draw polygon, I use the code below:

for jj = 0 to cntshape - 1
for ii = 0 to cntpt(jj) - 1
ptstmp(ii).x = shape(ii, jj).x
ptstmp(ii).y = shape(ii, jj).y
next
form1.polygon(ptstmp(), 0, cntpt(jj) - 1, cBlack, F)
next


I found that in PPC, the above for ii loop takes time (i.e. slow as one second when draw over 10 shapes).

If I can refer to one of the dimension I should be able to avoid the for ii loop.
e.g.
form1.polygon(shape(,jj), 0, cntpt(jj) -1 , cBlack, F)

Or any other way to do so?
 

hung

Active Member
Licensed User
Longtime User
Thanks :)

I am planning to keep a series of shapes that each shape is a series of points.

I can not define like

dim type (x, y) pts(500)
dim shape(1000) as pts

So I have to two dimensions array.

It would be great if the version 6.0 allows variable decaration using self defined type like pts (points).
 
Top