global-functions: deprecate $HexToNum

This commit is contained in:
Christian Hesse 2026-01-13 21:33:26 +01:00
parent 8a71079bdb
commit 9f6677f174
2 changed files with 15 additions and 14 deletions

View file

@ -7,3 +7,18 @@
#
# deprecated global functions
# https://rsc.eworm.de/
:global HexToNum;
# convert from hex (string) to num
:set HexToNum do={
:local Input [ :tostr $1 ];
:global HexToNum;
:if ([ :pick $Input 0 ] = "*") do={
:return [ $HexToNum [ :pick $Input 1 [ :len $Input ] ] ];
}
:return [ :tonum ("0x" . $Input) ];
}