I'm having trouble getting a declare statement working. Perhaps
someone here can help me set this up.
Here is the C documentation I have:
The function nc_get_var1_text gets a single data value from a variable
of an open netCDF dataset that is in data mode. Inputs are the netCDF
ID, the variable ID, a multidimensional index that specifies which
value to get, and the address of a location into which the data value
will be read. The value is converted from the external data type of
the variable, if necessary.
int nc_get_var1_text (int ncid, int varid, const size_t index[], char *tp);
ncid: NetCDF ID, from a previous call to nc_open or nc_create.
varid: Variable ID.
index[]: The index of the data value to be read. The indices
are relative to 0, so for example, the first data value of a
two-dimensional variable would have index (0,0). The elements
of index must correspond to the variable's dimensions. Hence,
if the variable is a record variable, the first index is the
record number.
tp Pointer to the location into which the data value is read.
Here is my RB code:
declare function nc_get_var1_text lib library ( _
ncid as integer, _
varid as integer, _
indexPtr as ptr, _
stringPtr as cstring ) _
as integer
dim stringPtr as memoryBlock = newMemoryBlock(256) // max string length
dim indexPtr as MemoryBlock = newMemoryBlock(8) // 2 array elements
// get the element at position (0,2)
indexPtr.long(0) = 0
indexPtr.long(4) = 2
dim err as integer
err = nc_get_var1_text( ncid, varid, indexPtr, stringPtr )
s = stringPtr.CString(0)
return err
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|