Difference between revisions of "StrToIntDef"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function StrToIntDef(s: string; def: Integer): Integer; </source> ==Availability== SCAR Divi 3.00 > Current ==Description== Co...")
 
(No difference)

Latest revision as of 16:16, 2 July 2011

Definition

function StrToIntDef(s: string; def: Integer): Integer;

Availability

SCAR Divi 3.00 > Current

Description

Converts a string s to an integer, if s is not an integer the function returns the value given by def.

Example

begin
  WriteLn(StrToIntDef('5', 5));
  WriteLn(StrToIntDef('a', 5));
end.

Output:

5
5

See Also