"For developers", "Server scripts", "Functions descriptions",  "Other", "High"

 

Getting the highest value of a specified variable.

 

Syntax

function High(var x): integer;

 

Parameters and return values

Parameter

Type

Value

x

any type

variable.

 

Function result

Integer value, the highest value of a variable.

 

Example

var
  i: integer;
  j: int64;
  a: array[0..3] of string;
begin
  mLogScript('Max value of integer : ' + inttostr(High(i)), '');
  mLogScript('Max value of int64   : ' + inttostr(High(j)), '');
  
    for i := 0 to 3 do a[i] := inttostr(random(100));
    
    for i := low(a) to high(a) do mLogScript('a[' + inttostr(i) + '] = ' + a[i], '');
end.

Script work result

[15:06:47] (Log "High"): Max value of integer : 2147483647

[15:06:47] (Log "High"): Max value of int64   : 9223372036854775807

[15:06:47] (Log "High"): a[0] = 99

[15:06:47] (Log "High"): a[1] = 21

[15:06:47] (Log "High"): a[2] = 19

[15:06:47] (Log "High"): a[3] = 13
 

See also

IntToStr

Low
mLogScript