Older Newer
Fri, 20 Dec 2019 13:03:56 . . . . SyneRyder [Initial function definition]


Changes by last author:

Added:
= __putArray =

== Syntax ==

int __putArray (int nr, int x, int y, int z, int val)

== Arguments ==

:nr

::Number of the array. Values from 0 to 99 are accepted.

:x, y, z

::x, y, and z coordinates of a cell in the array. If you allocated a one-dimensional array, set y and z to zero. If you allocated a two-dimensional array, set z to zero.

:val

::Value that will be stored at the specified coordinates in the array.

== Return ==

Returns 1 if the function succeeded, or 0 if there are more than 4 bytes per array cell. Warning: If the specified coordinates lie outside the array, the plug-in may crash.

== Description ==

Lets you store a value in an array. This is a fast version of putArray without any error checking or memory checking. As it does not do any border checking, it may produce error messages or even crashes if not used properly.

When storing a value into an Array with byte-size 1, the value will be clamped to the range [0,255]. For an Array of byte-size 2, the value is clamped to [0,65535]. If the byte-size is not 1, 2, or 4, a value of 0 is returned to indicate failure.

== Example ==

See allocArray for an example of how to allocate arrays and use the similar putArray function.

== See Also ==

__getArray, allocArray, freeArray, getArray, fgetArray, fputArray, fillArray, ffillArray, getArrayDim, copyArray