CPolygon:Count
The Count method returns the number of points in the CPolygon object.
nCount = CPolygon:Count() where |
nCount is the number of elements in the CPolygon. On failure, 0 is returned.
This method returns the number of members (or values) in the CPolygon. This is not the same thing as the maximum index in the array. For example, if the CPolygon has 2 members, one at index 1 and the other at index 10000, then Count = 2.
Suppose a CPolygon is created from 2 tables, each having 6 elements. The following script returns the number of points in the polygon:
|
-- table of x values |
|
-- table of y values |
|
-- create a CPolygon |
|
-- result: N = 6 |