PutShort


The PutShort method writes short integer (16 bit) sequence to file and returns number of elements actually written. File position is moved forward by the number of bytes written.
C++
long PutShort(
  short *ShortBuffer,              // buffer that contains data
  long NumberOfElements,           // number of elements to write
  long FilePosition = -1           // position of data in file
);
BASIC
PutShort(
  ShortBuffer As Variant,          // variant that contains data
  NumberOfElements As Long = -1,   // number of elements to write
  FilePosition As Long = -1        // position of data in file
) As Long

Parameters

ShortBuffer
C++
Pointer to buffer that contains data.
BASIC
Variant that contains data.
Variant type must be compatible with Integer data type; it can be either single variable or one-dimensional array.
NumberOfElements
Number of elements in data sequence to write.
BASIC
If this parameter is -1 length of sequence is determined by the size of ShortBuffer.
FilePosition
Position in file to write data at.
If this parameter is -1 data is written at current file position.

Return Values

If the method succeeds, the return value is the number of elements actually written.
If the method fails, the return value is failure code and error code is set. Call GetError to get error code.

Remarks

BASIC
ShortBuffer can be either single variable of type Integer or one-dimensional Integer array, depending on how many elements is to be written. If only one element is written, ShortBuffer can be a single variable, if more than one element is to be written it must be a one-dimensional array.

See Also

GetShort, PutBit, PutByte, PutLong, PutFloat, PutDouble, PutText, PutUnicodeText, PutVariant, PutBinary, Reading and Writing Data