OMget_iarray_val and OMget_rarray_val


Synopsis



int  OMget_iarray_val (OMobj_id object_id, int index,  int  *ivalue  );
int  OMget_rarray_val (OMobj_id object_id, int index,  double  *rvalue  );;

Description

These routines get a single element in an array object. These routines are suitable only for one-dimensional arrays. See the documentation for OMget_sub_barray and OMset_sub_barray for a more general routine that operates on multi-dimensional arrays.

The routines operate on different types of arrays.

This routine...

 

operates on...

 

OMget_iarray_val

An integer array

OMget_rarray_val

A floating-point array

 

Arguments

object_id

The id of an object. The object must be a one-dimensional array.

index

The index of the value to retrieve. AVS/Express uses 0-based indexing; i.e., the index of the first value in an array is 0.

ivalue
rvalue

An output argument containing the requested array value.

Returned value

The status code (see Return Status ).

Example

The V file below defines a one-dimensional array:


int myarray[5] = {1,2,3,4,5};

The following code segment gets the second element:


OMobj_id myarray_id;
int value;
int status;
...
status = OMget_iarray_val(my_array_id, 1, &value);