![]() |
![]() |
![]() |
![]() |
OMFset array
Synopsis
INTEGER FUNCTION OMFset array(object id,
. type,
. farray,
. size,
. mode)
#include <avs/omf.inc>
INTEGER object id(OIDSIZ)
INTEGER type, size, mode
DIMENSION farray(1)Description
For a complete description of this function, see OMset array .Arguments
object idtypeAn integer code specifying the array's data type. Valid types predefined in the include file omf.inc are:
farraysizemodeHow AVS/Express should set the array. The following constants are predefined in the include file omf.inc : OM SET ARRAY COPY OM SET ARRAY STATIC OM SET ARRAY FREEIf set to OM SET ARRAY STATIC, farray has to be a static array (notice that some FORTRAN compilers do not perform static memory allocation by default). If set to OM SET ARRAY COPY, farray needs not to be a static array since AVS/Express creates a copy.
Returned value
The status code (see OMset array).Example 1
A standard application of OMFset array:#include <avs/omf.inc>
INTEGER sarray id(OIDSIZ) larray id(OIDSIZ)
DOUBLE PRECISION sarray(500)
INTEGER larray(3,100)
...
C sarray has to be a static array to make the following work
C correctly. The call will not fail if this condition is not
C satisfied.
C
IF (OMFset array(sarray id,
. OM TYPE DOUBLE,
. sarray,
. 500,
. OM SET ARRAY STATIC) .NE. 1)
. PRINT*,'Error setting array value of object sarray'
C
IF (OMFset array(larray id,
. OM TYPE INT,
. larray,
. 300,
. OM SET ARRAY COPY) .NE. 1)
. PRINT*,'Error setting array value of object larray'Example 2
The construction required to pass a memory area allocated by ARRFalloc:#include <avs/omf.inc>
INTEGER array id(OIDSIZ)
INTEGER iaddr, offset, size
DOUBLE PRECISION base(1)
...
size = 300
iaddr = ARRFalloc(0,DTYPE DOUBLE,size,0)
offset = ARRFoffset(iaddr,base,DTYPE DOUBLE)
...
C
IF (OMFset array(array id,
. OM TYPE DOUBLE,
. base(1+offset),
. 300,
. OM SET ARRAY FREE) .NE. 1)
. PRINT*,'Error setting array value of object array'See Also
![]() |
![]() |
![]() |
![]() |