Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
procedure Val(const S: string; var Result; var Code: integer);
Converts a string to a numeric value.
S is a string-type expression; it must be a sequence of characters that form a signed real number. The Result argument can be an Integer or floating-point variable. Code is zero if the conversion is successful. If the string is invalid, the index of the offending character is stored in Code.
Val does not heed the local settings for the decimal separator.
var s : string;
c,i : integer;
s:='1234';
Val(s,i,c);
//i=1234; //c=0
|
String Types in Delphi
Understanding and managing string data types in Delphi's Object Pascal. Learn about differences between Short, Long, Wide and null-terminated strings.
Str,
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|