Programming-Idioms

History of Idiom 22 > diff from v29 to v30

Edit summary for version 30 :
[Pascal] Comment emphasize

Version 29

2015-12-30, 21:26:58

Version 30

2015-12-30, 21:27:44

Idiom #22 Convert string to integer

Extract integer value i from its string representation s (in radix 10)

Idiom #22 Convert string to integer

Extract integer value i from its string representation s (in radix 10)

Code
uses SysUtils;
var
  i: Integer;
 S: String;
begin
  S := '123';
  i := StrToInt(S);
end.
Code
uses SysUtils;
var
  i: Integer;
 S: String;
begin
  S := '123';
  i := StrToInt(S);
end.
Comments bubble
The function StrToInt will raise an exception of type EConvertError if the string is not a proper representation of an integer.
Comments bubble
The function StrToInt will raise an exception of type EConvertError if the string is not a proper representation of an integer.