Skip to main content

StructGet

StructGet [/B=b ] structVar, waveStruct [[colNum ]]

StructGet /S [/B=b ] structVar, strStruct

The StructGet operation reads binary numeric data from a specified column of a wave or from a string variable and copies the data into the specified structure variable. The source wave or string will have been filled beforehand by StructPut.

Parameters

structVar is the name of an existing structure that will be filled with new data values.

waveStruct is the name of a wave containing binary numeric data that will be used to fill the structure. Use the optional colNum parameter to specify a column from the structure wave. The contents of waveStruct are created beforehand using StructPut.

strStruct is the name of a string variable containing binary numeric data. The contents of strStruct are created beforehand using StructPut.

Flags

/B=bSets the byte ordering for reading of structure data.
b =0:Reads in native byte order.
b =1:Reads bytes in reversed order.
b =2:Default; reads data in big-endian, high-byte-first order (Motorola).
b =3:Reads data in little-endian, low-byte-first order (Intel).
/SReads binary data from a string variable, which was set previously using StructPut.

Details

The data that are stored in waveStruct and strStruct are in binary format so you cannot directly view a meaningful representation of their contents by printing them or viewing the wave in a table. To view the contents of waveStruct or strStruct you must use StructGet to export them back into a structure and then retrieve the members.

If colNum is out of bounds it will be clipped to valid values and an error reported. If the row dimension does not match the structure size, as much data as possible will be copied to the structure.

By default, data are read in big-endian, high-byte order (Motorola). This allows data written on one platform to be read on the other.

See Also

The StructPut operation for writing structure data to waves or strings.