Difference between revisions of "StrToInt"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function StrToInt(s: string): Integer; </source> ==Availability== SCAR Divi 3.00 > Current ==Description== Converts a [[string...")
 
 
Line 8: Line 8:
  
 
==Description==
 
==Description==
Converts a [[string]] '''s''' to an [[integer]], if '''s''' is not an integer the script will return -1.
+
Converts a [[string]] '''s''' to an [[integer]], if '''s''' is not an integer the function will return -1.
  
 
==Example==
 
==Example==

Latest revision as of 17:17, 2 July 2011

Definition

function StrToInt(s: string): Integer;

Availability

SCAR Divi 3.00 > Current

Description

Converts a string s to an integer, if s is not an integer the function will return -1.

Example

begin
  WriteLn(StrToInt('5'));
  WriteLn(StrToInt('a'));
end.

Output:

5
-1

See Also