$Unbin: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
<p>The $UNBIN function converts a value from its fixed-point binary form to the corresponding character string representation. The $UNBIN function reverses the effect of the $BINARY function.</p>
<p>The $UNBIN function converts a value from its fixed-point binary form to the corresponding character string representation. The $UNBIN function reverses the effect of the $BINARY function.</p>
<p class="warn">Most $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $UnBin function is the <var>[[BinaryToInteger (String function)|BinaryToInteger]]</var> function.</p>
<p class="warn"><b>Note: </b>Most $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $UnBin function is the <var>[[BinaryToInteger (String function)|BinaryToInteger]]</var> function.</p>
<b>Syntax</b>
<b>Syntax</b>
<p>The format of the $UNBIN function is: </p>
<p>The format of the $UNBIN function is: </p>

Revision as of 19:15, 18 July 2013

The $UNBIN function converts a value from its fixed-point binary form to the corresponding character string representation. The $UNBIN function reverses the effect of the $BINARY function.

Note: Most $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $UnBin function is the BinaryToInteger function.

Syntax

The format of the $UNBIN function is:

$UNBIN(value [,scale] )

where:

  • value is a string argument. This argument must be either two or four bytes long; its value is interpreted as a bit string. If the length of the argument is not two or four bytes, Model 204 issues a counting error message and returns a null string.
  • scale indicates the number of fractional digits (bits) in the specified value. If the scale argument is omitted, a default value of 0 (integer) is used.

For $UNBIN the useful range for scale seems to be about 0-38 or 0-42, depending on the value of the first parameter.