vpoint.sml

  Download

More scripts: Vector

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
# vpoint.sml
clear();
vector V;
array numeric xPoints[10], yPoints[10], pointList[10];
numeric numPoints;
GetOutputVector(V, "VectorToolkit");
#initialize some points
xPoints[1] = 0;
yPoints[1] = 0;
xPoints[2] = 100;
yPoints[2] = 0;
xPoints[3] = 100;
yPoints[3] = 100;
xPoints[4] = 0;
yPoints[4] = 100;
# add 4 points
numeric i;
for i = 1 to 4 {
	VectorAddPoint(V, xPoints[i], yPoints[i]);
	}
numPoints = NumVectorPoints(V);
print("number of points: ", numPoints);
VectorDeletePoint(V, 1);
numPoints = NumVectorPoints(V);
print("number of points: ", numPoints);
pointList[1] = 1;
pointList[2] = 2;
VectorDeletePoints(V, pointList, 2);
numPoints = NumVectorPoints(V);
print("number of points: ", numPoints);