PUT#

Syntax:

PUT #<logical_file_number>, <value>

The PUT# command outputs a single numeric value to a file that was previously open using the OPEN command. Writing numeric values to a file using PUT# instead of PRINT# is more efficient space and speedwise because PUT# stores numbers as binary data, whereas PRINT# stores numeric values as strings.

  • If the value is a BYTE type, a single byte will be written.
  • If the value is a WORD or INT type, two bytes will be written in low byte - high byte order.
  • If the value is a DECIMAL type, two bytes will be written in high byte - low byte order.
  • If the value is a LONG type, two bytes will be written in low byte - mid byte - high byte order.
  • If the value is a FLOAT type, four bytes will be written in exponent, mantissa 1, mantissa 2 and mantissa 3 order.