diff --git a/Units/MMLAddon/PSInc/Wrappers/math.inc b/Units/MMLAddon/PSInc/Wrappers/math.inc index 486dbce..cdfecb9 100644 --- a/Units/MMLAddon/PSInc/Wrappers/math.inc +++ b/Units/MMLAddon/PSInc/Wrappers/math.inc @@ -163,3 +163,13 @@ function ps_ln(x : extended) : extended;extdecl; begin result := ln(x); end; + +function ps_inttohex(value : integer) : string; +begin + result := IntToHex(value,1); +end; + +function ps_hextoint(hex : string) : integer; +begin + result := StrToInt('$' + hex); +end; diff --git a/Units/MMLAddon/PSInc/psexportedmethods.inc b/Units/MMLAddon/PSInc/psexportedmethods.inc index 2be7e8b..4263505 100644 --- a/Units/MMLAddon/PSInc/psexportedmethods.inc +++ b/Units/MMLAddon/PSInc/psexportedmethods.inc @@ -71,6 +71,8 @@ AddFunction(@ps_FixD,'function FixD(Degrees : extended) : Extended;'); AddFunction(@ps_InRange,'function InRange(const value,min,max : integer) : boolean;'); AddFunction(@ps_logn,'function logn(base, x : extended): extended;'); AddFunction(@ps_ln,'function ln(x : extended) : extended;'); +AddFunction(@ps_inttohex,'function IntToHex(number : integer) : string'); +AddFunction(@ps_hextoint,'function HexToInt(Hex : string) : integer'); {window} SetCurrSection('Window');