Skip to main content

FBInWrite

FBinWrite [/B[=b ]/F=f ] refNum, objectName

The FBinWrite operation writes the named object in binary to a file.

Parameters

refNum is a file reference number from the Open operation used to open the file.

objectName is the name of a numeric variable, string variable, structure, or wave.

Flags

/B[=b ]Specifes file byte ordering.
b =0:Native (same as no /B).
b =1:Reversed (same as /B).
b =2:Big-endian (Motorola).
b =3:Little-endian (Intel).
/F=fControls the number of bytes written and how the bytes are formatted when written.
f =0:Native binary format of the object (default).
f =1:Signed byte; one byte.
f =2:Signed 16-bit word; two bytes.
f =3:Signed 32-bit word; four bytes.
f =4:32-bit IEEE floating point; four bytes.
f =5:64-bit IEEE floating point; eight bytes.
f =6:64-bit integer; eight bytes. Requires Igor Pro 7.00 or later.
/PAdds an IgorBinPacket to the data. This was used for PPC result packets (refNum = 0) and is not normally of use when writing to a file.
/UInteger formats (/F=1, 2, or 3) are unsigned. If /U is omitted, integers are signed.

Details

A zero value of refNum is used in conjunction with Program-to-Program Communication (PPC) ActiveX Automation (Windows). The data that would normally be written to a file is appended to the PPC or ActiveX Automation result packet.

If the object is a string variable then /F doesn't apply. The number of bytes written is the number of bytes in the string.

The binary format that FBinWrite uses for numeric variables or waves depends on the /F flag. If no /F flag is present, FBinWrite uses the native binary format of the named object.

Byte ordering refers to the order in which a multibyte datum is written to a file. For example, a 16-bit word (sometimes called a "short") consists of a high-order byte and a low-order byte. Under big-endian byte ordering the high-order byte is written to the file first. Under little-endian byte ordering the low-order byte is written to the file first.

FBinWrite will write an entire structure to a disk file. The individual fields of the structure will be byte-swapped if the /B flag is designated.

The FBinWrite operation is not multidimensional aware. See Multidimensional Waves, particularly Analysis on Multidimensional Waves for details.

See Also

FBinRead, Open, FGetPos, FSetPos, FStatus, GBLoadWave