HTBasic Help
×
Menu
Index

IVAL$

Converts an INTEGER to a binary, octal, decimal or hexadecimal string.
 
 IVAL$( number, radix )
 
Usage:
Hex$=IVAL$(Number,Sixteen)
PRINT IVAL$(I,8)
 
Example:           IVAL$.BAS
 
Description:
IVAL$ is like VAL$, in that a numeric value is converted to string form. Unlike VAL$, which always expresses numbers in decimal form, IVAL$ can also express numbers in binary, octal, decimal and hexadecimal.
 
The number must be in the range -32768 to +32767 and the radix must be either 2, 8, 10 or 16.
 
The converted numbers have leading zeros as necessary to fill unused digit positions. A minus sign is only produced for decimal numbers. The range of numbers produced is the same as those accepted by IVAL.
 
See Also: