diff --git a/Units/MMLAddon/PSInc/Wrappers/math.inc b/Units/MMLAddon/PSInc/Wrappers/math.inc index c7dfb7b..1dacd78 100644 --- a/Units/MMLAddon/PSInc/Wrappers/math.inc +++ b/Units/MMLAddon/PSInc/Wrappers/math.inc @@ -25,3 +25,8 @@ function psSqr( e : extended) : extended; begin; result := sqr(e); end; + +function ps_RandomRange(const aFrom, aTo: Integer): Integer; +begin + Result:=Random(Abs(aFrom-aTo))+Min(aTo,AFrom); +end; diff --git a/Units/MMLAddon/PSInc/psexportedmethods.inc b/Units/MMLAddon/PSInc/psexportedmethods.inc index 4262a9e..2c1500b 100644 --- a/Units/MMLAddon/PSInc/psexportedmethods.inc +++ b/Units/MMLAddon/PSInc/psexportedmethods.inc @@ -51,7 +51,7 @@ AddFunction(@pssqr,'function Sqr(e : extended) : extended;'); AddFunction(@classes.point,'function Point(x,y:integer) : TPoint;'); AddFunction(@Distance,'function Distance(x1,y1,x2,y2 : integer) : integer;'); AddFunction(@hypot,'function Hypot(X, Y: Extended): Extended;'); -AddFunction(@RandomRange,'function RandomRange(aFrom,aTo: Integer): Integer;'); +AddFunction(@ps_RandomRange,'function RandomRange(aFrom,aTo: Integer): Integer;'); {window} SetCurrSection('Window');