This bit
richmond62 wrote: ↑Mon Oct 07, 2024 4:13 pm
Code: Select all
for (i=0x0; i < 0x30; i++) { print("0x0" + i.toString(16) +" = " + i) }
only initialises the two values to control the loop from the hex values 0x0 and 0x30. There's no functional difference in specifying those values as decimal integers 0 and 48. Internally, the loop stores those values presumably as binary floats. Or piles of pebbles. Or whatever. The loop is not counting in hex - the output has to be constructed by creating a string from "0x0" and the value of the loop index
converted to a string representation in base 16 with the appropriate syntax. That's no less "fudgy" than using LC baseConvert syntax.
It should be very straightforward to use baseConvert in the pseudocode loop you mentioned to make this real code, without bending it much.