We have the wonderful HEX$() and BIN$() functions.
Do we have plans for the reverse - an extension to the VAL() function to cope with HEX and BIN strings being supplied?
Convert hex string to decimal
Re: Convert hex string to decimal
It's been discussed on the Discord. I believe it's underway.
-
- Posts: 140
- Joined: Tue Jul 21, 2020 10:08 pm
Re: Convert hex string to decimal
Thanks for letting me know - sounds good!
Re: Convert hex string to decimal
I have written an X16 BASIC program to convert between arbitrary bases called baseconv.bas:
https://github.com/mobluse/chargen-make ... seconv.bas
You can paste it into the emulator.
Usage example:
https://github.com/mobluse/chargen-make ... seconv.bas
You can paste it into the emulator.
Usage example:
RUN IN BASE,OUT BASE,NUMBER? 16,10,ABCD BASES: IN I= 16 OUT O= 10 43981 READY. RUN IN BASE,OUT BASE,NUMBER? 10,16,43981 BASES: IN I= 10 OUT O= 16 ABCD READY.
-
- Posts: 140
- Joined: Tue Jul 21, 2020 10:08 pm
Re: Convert hex string to decimal
Fantastic - thank you !
Re: Convert hex string to decimal
Now that's classic micro programming. There were a ton of such programs in the early days of home computing. These days, however, you can find a ton of these online, which are more useful thanks to the multi-tasking OSes we have today.mobluse wrote: ↑Tue Jul 04, 2023 9:27 pm I have written an X16 BASIC program to convert between arbitrary bases called baseconv.bas:
https://github.com/mobluse/chargen-make ... seconv.bas
You can paste it into the emulator.
Usage example:RUN IN BASE,OUT BASE,NUMBER? 16,10,ABCD BASES: IN I= 16 OUT O= 10 43981