FutureBasic Logo

<<    Index    >> FutureBasic 5

uns$   function

digitPascalString = uns$(expr)

This function interprets the internal bit pattern of expr as an unsigned integer, then returns a string of decimal digits representing that integer's value. The length of the returned string depends on which of defstr byte, defstr word or defstr long is currently in effect; the returned string may be padded on the left with one or more "0" characters, to make a string of the indicated length.
If expr is a positive integer, then the number represented in the returned string will be the same as the value of expr (provided that the current defstr mode allows uns$ to return sufficient digits).
If expr is a negative integer, then its internal bit pattern is different from that of an unsigned integer. In this case, the number represented in the returned string will be:
To convert a "signed integer" expression sexpr into an "unsigned integer" expression which has the same internal bit pattern, just assign sexpr to an unsigned integer variable. For example:
myUnsLong&` = mySignedLong&

See Also:
defstr byte/word/long; hex$; oct$; bin$; Appendix C - Data Types and Data Representation