FutureBasic Logo

<<    Index    >> FutureBasic

defstr   statement



Syntax
defstr {long | int | word | byte}

Description
These statements affect the way several integer-to-string functions format their return values. Basically, they affect whether the string functions interpret their arguments as 64-bit, 32-bit, 16-bit or 8-bit integers. The statements are global in scope, and apply to all subsequent calls to the affected string functions, until another defstr statement is executed. When the program starts, defstr long is in effect. The following table shows how the statements affect the return values of the various string functions.


bin$ hex$ oct$ uns$ mki$
defstr long (default)
returns 64 characters
returns 16 characters
returns 11 characters
10 characters; adds 232 if arg < 0
returns 4 characters
defstr int (default)
returns 32 characters
returns 8 characters
returns 11 characters
10 characters; adds 232 if arg < 0
returns 4 characters
defstr word returns 16 characters
returns 4 characters
returns 6 characters
5 characters; adds 216 if arg < 0
returns 2 characters
defstr byte returns 8 characters
returns 2 characters
returns 3 characters
3 characters; adds 256 if arg < 0
returns 1 character

When defstr byte is in effect, the string functions may not return the expected result if the integer argument lies outside of the range -255 to +255. Likewise, when defstr word is in effect, the string functions may not return the expected result if the integer argument lies outside of the range -65535 to +65535.

See also
bin; hex; oct; uns$; mki$