StrToIntDef

From SCAR Divi Manual
Revision as of 16:16, 2 July 2011 by Freddy (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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