Difference between revisions of "StrToBool"
From SCAR Divi Manual
(Created page with "==Definition== <source lang="scar" lines="false"> function StrToBool(Str: AnsiString): Boolean; </source> ==Availability== SCAR Divi 3.00 > Current ==Description== Converts a g...") |
|||
Line 1: | Line 1: | ||
==Definition== | ==Definition== | ||
<source lang="scar" lines="false"> | <source lang="scar" lines="false"> | ||
− | function | + | function StrToFloat(s: string): Extended; |
</source> | </source> | ||
Line 8: | Line 8: | ||
==Description== | ==Description== | ||
− | Converts a given [[AnsiString|string]] ''' | + | Converts a given [[AnsiString|string]] '''s''' to an [[extended]] floating point value. If '''s''' is not a valid floating point value, the function throws an exception "Invalid float". |
==Example== | ==Example== | ||
<source lang="scar"> | <source lang="scar"> | ||
begin | begin | ||
− | WriteLn( | + | WriteLn(StrToFloat('1.5')); |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
end. | end. | ||
</source> | </source> | ||
Output: | Output: | ||
− | 1 | + | 1,5 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==See Also== | ==See Also== | ||
− | *[[ | + | *[[StrToFloatDef]] |
− | *[[ | + | *[[FloatToStr]] |
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:Conversion Functions]] | [[Category:Conversion Functions]] | ||
[[Category:Data Functions]] | [[Category:Data Functions]] |
Revision as of 17:02, 5 July 2011
Definition
function StrToFloat(s: string): Extended;
Availability
SCAR Divi 3.00 > Current
Description
Converts a given string s to an extended floating point value. If s is not a valid floating point value, the function throws an exception "Invalid float".
Example
begin WriteLn(StrToFloat('1.5')); end.
Output:
1,5