vlabel.sml

  Download

More scripts: Vector

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
# vlabel.sml
clear();
vector V;
array numeric labelList[10];
string label$;
numeric height;
numeric x1, y1, x2, y2;
numeric numLabels;
GetOutputVector(V, "VectorToolkit");
label$ = "abcdEFG";
height = 20;
x1 = 20;
y1 = 10;
x2 = 40;
y2 = 10;
numLabels = NumVectorLabels(V);
print("number of labels: ", numLabels);
# add 4 labels
numeric i;
for i = 1 to 4 {
	VectorAddLabel(V, label$, height, x1, y1, x2, y2);
	y1 += 25;
	y2 += 25;
	height /= 2;
	}
numLabels = NumVectorLabels(V);
print("number of labels: ", numLabels);
VectorDeleteLabel(V, 1);
numLabels = NumVectorLabels(V);
print("number of labels: ", numLabels);
labelList[1] = 1;
labelList[2] = 2;
VectorDeleteLabels(V, labelList, 2);
numLabels = NumVectorLabels(V);
print("number of labels: ", numLabels);