Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有数字作为字符串。如何将该字符串转换为 LongWord?
我知道如何将其转换为整数。但是整数对我来说太小了。
实际上你可以使用 StrToInt。
结果值将溢出(即,对于高于 $7fffffff 的值变为负数,您可能希望禁用溢出检查),但是当它转换为 longword 时,您将获得正确的值。
尽管低水平的 Val 可能更安全:
var x: longword; e: word; begin Val('$9fffffff', x, e); writeln(x); end.