Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9027987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:52:41+00:00 2026-06-16T06:52:41+00:00

I have a program here which was working fine in Delphi 3 that I

  • 0

I have a program here which was working fine in Delphi 3 that I compiled and tested on Turbo Delphi 2006 and found a problem. The problem is this: I was using "cardinal" data types as an index for something. It worked in Delphi 3, but I found values were greater than they should be in the Turbo Delphi 2006 compiled version by about 128-256 or so depending on the specific data. Changing these data types to "longint" fixed the problem so the program worked correctly with both compilers.

The question: Why is this?

My understanding was that Cardinal data types were just typical unsigned integer data. This is consistent with the application of them in this program, especially proved by the fact that the Delphi 3 compilation worked correctly. So why did the Turbo Delphi 2006 compilation not work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:52:42+00:00Added an answer on June 16, 2026 at 6:52 am

    In Delphi, unsigned types are just subrange types of the next larger signed type. In Delphi 3, there is no 64-bit type, so there is no next larger type for Cardinal to be a subrange of. Cardinal is a signed type in Delphi 3 because of a technical limitation in the language. Delphi 4 introduced Int64, and Cardinal was made to be an unsigned subrange of that type (and then the limitation was that the was no unsigned 64-bit type).

    In short, you were never getting true unsigned behavior in the first place. Now that you’ve upgraded, you’ve exposed long-present problems that have always been in your code.

    That your code compiled is no proof that your code was correct. Delphi 3 cannot enforce rules that require types it doesn’t really have.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

NOTE: This is a followup to my question here. I have a program that
In this case I have some code which is working without problem in an
I have an Android application (java) that was working fine when compiled with the
A slightly archaic question I'm afraid but here goes: I have a program which
Just a quick question here. I have a program in which I need to
i found many related questions here. I have a simple java program . it
Well, i have written a simple python program that parses HTML with HTMLParser. Here
I have a simple rectangle here in my program on which I had to
I am working on a Delphi program which will display an icon on the
I have a program that reads in a file. All my classes compile fine,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.