OMFret_typed_array_ptr


Synopsis


INTEGER FUNCTION OMFret_typed_array_ptr(object_id,
      . mode,
      . type,
      . size)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER mode, type
       INTEGER size

Description

For a complete description of this function, see .

Arguments

object_id

The id of an object, expressed as an integer.

mode

Integer code specifying the mode in which to retrieve the the value for the array. The following constants are predefined in the include file omf.inc :

•      OM_GET_ARRAY_RD

•      OM_GET_ARRAY_RD_COPY

•      OM_GET_ARRAY_RW

•      OM_GET_ARRAY_WR

type

Integer code for the array's data type. Valid types predefined in the include file omf.inc are:

Code

 

Array data type

 

OM_TYPE_INT

Integer

OM_TYPE_FLOAT

Single-precision floating point

OM_TYPE_DOUBLE

Double-precision floating point

OM_TYPE_UNSET

Not set (for example, data type is prim)

 

size

The total number of values in the array. In order to pass the NULL reference, set the value to FPNULL (defined in the include file omf.inc ).

Returned value

The memory location of the returned array. On failure, 0 is returned.

Example


C return the array value of object array for RW access
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER iaddr, offset, size
       DOUBLE PRECISION base(1)
       ...
       iaddr = OMFret_typed_array_ptr(array_id,
      . OM_GET_ARRAY_RW,
      . OM_TYPE_DOUBLE,
      . size)
       IF (iaddr .EQ. 0) THEN
        PRINT*,'Error getting array value of object array'
        ...
       ENDIF
C
C  continue only for iaddr .ne. 0
       offset = ARRFoffset(iaddr,base,DTYPE_FLOAT)
C
C  set the values of the array
       ...
       CALL ARRFfree(iaddr)