"For developers", "Server scripts", "Functions descriptions",  "Other", "Max".

 

Getting the grater value of two numeric values.

 

Syntax

function Max(iValue1, iValue2: integer): integer;

 

Parameters and return values

Parameter

Type

Value

iValue1

integer

first number;

iValue2

integer

second value.

 

Fucntion result

Greater value of two integers.

 

Example

var
  iVal1, iVal2, iMax: integer;
begin
  iVal1 := 37;
  iVal2 := 38;
  
  iMax := Max(iVal1, iVal2);
  mLogScript('value 1 = ' + IntToStr(iVal1), '');
  mLogScript('value 2 = ' + IntToStr(iVal2), '');
  mLogScript('Max value is: ' + IntToStr(iMax), '');
end.

Script work result

[19:02:02] (Log "Max"): value 1 = 37

[19:02:02] (Log "Max"): value 2 = 38

[19:02:02] (Log "Max"): Max value is: 38

[19:02:02] (Run "Max"): Script operation time: 4 ms

[19:02:02] (Run "Max"): Script done successfully.
 

See also

IntToStr
mLogScript