How do I convert an integer variable into a string variable with smartBASIC?

While there are several options for converting from string to other data types in smartBASIC including STRHEXIZE$, STRDEHEXIZES$, STRHEX2BIN, and STRESCAPE$, the conversion from integer to string data type is accomplished using the SPRINT function as outlined in the smartBASIC Core Functionality User Manual (p.75). In comparison to “PRINT” which is used as an output function, “SPRINT” (SPRINT #s$, INTEGER.’a) replaces the content of s$ with the content of “a” in either Hex, Octal, or Binary format. For the example a = 100, the stored value for s$ would be 64 in Hex, 144 in Octal, and 1100100 (leading zeros truncated) in Binary.

Categories