2

How to convert String to LongInt in Delphi XE3? strtoInt & strToint64 are for variables of types less than LongInt.

6
  • 1
    which platform do you talk about ? in Win32 and Apple32 platforms Int64 is 2^32 times more than LongInt. Don't remember about Win64 though Commented Nov 28, 2012 at 12:51
  • i'm talking about windows, both win32 and overloaded version for 64 Commented Nov 28, 2012 at 14:18
  • 2
    LongInt is 32 bits Integer on all platforms! Commented Nov 28, 2012 at 16:23
  • @jachguate not according to the documentation: "On 32-bit platforms and 64-bit Windows platforms, LongInt is an 4-byte signed integer ... On 64-bit POSIX platforms (iOS and Linux), LongInt is an 8-byte signed integer" Commented Oct 10, 2022 at 18:51
  • 1
    @jachguate Understandable, as at the time, XE3 was the latest version, which didn't support any 64-bit Posix platforms yet, only 64-bit Windows, and LongInt is indeed a 32-bit integer on Win64. Commented Oct 10, 2022 at 20:21

2 Answers 2

7

Looking at its signature, I don't think StrToInt is for int less than longint. Integer is an alias for LongInt in Delphi by default. Here is the table for those types.

Sign up to request clarification or add additional context in comments.

Comments

3

The ...StrToInt...() overloads that work with Integer values will be fine. Integer and LongInt have the same byte size and value range on Windows.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.