MyChat Scripts Engine: StrToInt64Def
Converting a text string to a 64-bit integer with an optional sign, considering the default value.
Syntax
function StrToInt64Def(st: string; iDefaultValue: int64): int64;
Parameters and return values
Parameter |
Type |
Value |
st |
string |
source string; |
iDefaultValue |
int64 |
default integer value that returns if the conversion fails. |
Function result
64-bit integer that corresponds to the transmitted string, or the default value.
Example
begin
mLogScript(IntToStr(StrToInt64Def('7vsjvds777157', 74722777157)), '');
mLogScript(IntToStr(74722777157), '');
end.
Script works result
[18:41:48] (Log "TestStrToInt"): 74722777157
[18:41:48] (Log "TestStrToInt"): 74722777157
[18:41:48] (Run "TestStrToInt"): ВремяScript operation time: 7 ms
[18:41:48] (Run "TestStrToInt"): Script done successfully.