[fpc-pascal] Re: Convert error hex string to cardinal....

Bo Berglund bo.berglund at gmail.com
Mon Jan 17 23:54:23 CET 2011


On Mon, 17 Jan 2011 23:29:07 +0100, Vincent Snijders
<vincent.snijders at gmail.com> wrote:

>2011/1/17 Bo Berglund <bo.berglund at gmail.com>:
>> I have encountered a conversion error using FPC 2.4.2 with Lazarus
>> 0.9.29 as follows:
>>
>> var
>>  t: Int64;
>>  v: string;
>> begin
>>  ...
>>  t := StrToInt('$' + v);
>>
>> This gives an exception "invalid integer". At this moment v is
>> '577B4D58A51A0EE', which combined with the $ sign makes it a valid hex
>> Int64 as far as I can see.
>
>For Int64 use StrToInt64:
>http://lazarus-ccr.sourceforge.net/docs/rtl/sysutils/strtoint64.html
>

Thanks for the quick solution! :-)


-- 
Bo Berglund
Developer in Sweden




More information about the fpc-pascal mailing list