Ciao.
Riporto dal solito forum int. una segnalazione che ritengo abbastanza importante (qui il link: https://forum.lazarus.freepascal.org/index.php/topic,70110.0.html ):
eseguendo una conversione da stringa ad intero, se il risultato ha un valore maggiore del limite di capacità della variabile ricevente sembra che nessun errore venga generato.
Il problema si presenta sia con StrToInt() che con TryStrToInt() e pare che sia presente solo nel compilatore a 64 bit.
program PgmStrToInt;
uses
SysUtils;
const
cStr: string = '355685667191548007';
var
vStr: String;
vInt: integer;
vInt64: int64;
begin
vStr := cStr + '8'; // Usa una variabile
vInt64 := StrToInt64(vStr); // OK
WriteLn(vInt64, ' ', HexStr(vInt64, 16)); // OK
vInt := StrToInt(vStr); // QUI DEVE GENERARE UN ERRORE, MA NON ACCADE
WriteLn(vInt, ' ', HexStr(vInt, 8)); // Sembra che mantenga solo i 4 byte più "bassi"
WriteLn(TryStrToInt(vStr, vInt)); // Ritorna TRUE (dovrebbe essere FALSE)
ReadLn;
end.