Point.SetArray (method)


Point.SetArray array [, startElement [, endElement [, fromElement]]]


To set an array point's values directly from a Basic array.


There are several rules to keep in mind:

If the array is dimensioned smaller than the point, only that many elements will be copied into the point.

If the array is larger than the point, all elements of the array are copied, and the rest of the array is ignored.

If the startElement is specified, the function will start copying data from the array at this element and will continue until the end of the array is reached or the point is full whichever occurs first.

If the endElement is specified, the function will stop copying data from the array after copying this element or when the point is full.

If the fromElement is specified, the values copied from the array start at this element in the point array and continue as described above.






Array. A dimensioned or undimensioned Basic Array from which the point data will be copied.



Integer. (optional) The first array element from which data will be copied.



Integer. (optional) The last array element from which data will be copied.



Integer. (optional) The first point element to which data is to be copied.


' Read an array point, sort the elements by value and write them

' out to CIMPLICITY sorted.

sub main()

    Dim x() as integer         'Declare the value array

    Dim MyPoint as new Point     'Declare the point object

    MyPoint.id ="POINTNAME"     'Assign point to script

    MyPoint.Get                  'Get the point value

    MyPoint.GetArray x           'Transfer point element into array

    ArraySort x                'Sort the array

    MyPoint.SetArray x           'Transfer to array into the point

    MyPoint.Set                  'Transfer the sorted data to CIMPLICITY.

end sub

See Also

Point.SetRawArray (method); Point.Value (property, read/write), Point.GetArray (method); Point.Set (method).


The SetArray method only updates the internal value of the point object. The Set method must be executed to write the value out to the CIMPLICITY project.

More information

CIMPLICITY Extensions to Basic