next up previous 372
Next: NBS_GET_SHAPE - Get the shape of a primitive item associated with the specified identifier
Up: Description of Individual NBS Routines
Previous: NBS_GET_VALUE - Get a byte array from a slice of a primitive item associated with the specified identifier


NBS_GET_CVALUE - Get a character string from a slice of a primitive item associated with the specified identifier

Description:
Extracts the string data pointer and string length from the FORTRAN argument list, and passes this information to NBS_GET_VALUE. Thus, the number of bytes read is at most the length the string supplied.

Invocation:
(Int) = NBS_GET_CVALUE (ID,OFFSET,STRING,ACTBYTES,STATUS)

Arguments:

ID = INTEGER (Given)
Identifier of the item from which thew value is to be got.
OFFSET = INTEGER (Given)
Byte offset into item data.
STRING = CHARACTER*(*) (Returned)
Users string buffer into which item bytes will be got.
ACTBYTES = INTEGER (Returned)
Actual number of values associated with the item. This may be greater than OFFSET + LEN(STRING) but no more than LEN(STRING) bytes will be copied into the user's buffer.
STATUS = INTEGER (Given and returned)
The global status. Possible return values are,

NBS__NILID   		 NIL ID 

NBS__NOTPRIMITIVE Item is not primitive
NBS__BADOFFSET Negative offset specified
NBS__TIMEOUT Timeout awaiting valid data

Notes:
No C version of this routine is supplied because C strings are by convention null terminated. As NBS_GET_CVALUE writes new string data, its correct functioning in the C case would rely on the unwarranted assumption that sufficient space existed in the destination string for the data to be written. By forcing the use of NBS_GET_VALUE in this case, the user must at least state the destination length explicitly.


next up previous 372
Next: NBS_GET_SHAPE - Get the shape of a primitive item associated with the specified identifier
Up: Description of Individual NBS Routines
Previous: NBS_GET_VALUE - Get a byte array from a slice of a primitive item associated with the specified identifier

NBS The Noticeboard System
Starlink User Note 77
D.J. Allan
11 September 1995
E-mail:ussc@star.rl.ac.uk