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 6929839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:22:10+00:00 2026-05-27T11:22:10+00:00

I have defined a TCGTable record type with the following structure: type TCGTable =

  • 0

I have defined a TCGTable record type with the following structure:

type
  TCGTable = record
    x : array [1 .. MAX_POINTS] of Single;
    y : array [1 .. MAX_POINTS] of Single;
  end;

I have declared a TCGTable variable CGTable.

The variable CGTable is assigned a particular constant TCGTable record value if that record meets several runtime conditions.

If no constant TCGTable record meets these conditions, CGTable should be undefined.

Is there a Delphi 2010 built-in value I can assign to CGTable to indicate that it is undefined? I have tried using the values nil and null, but both of these seem to be valid only for pointer or variant types. The source will not compile with these values assigned to CGTable.

I would like to inspect the variable CGTable to determine its validity instead of, for example, maintaining some additional boolean validity flag.

The only workarounds I can determine are:

a) Change the type of CGTable to a TCGTable pointer (CGTable : ^TCGTable;), which would then allow me to compare CGTable to the nil value.

b) Define some constant TCGTable record to act as an “invalid” record. I would then compare CGTable against this “invalid” record.

Any suggestions on how to approach this? Thanks

  • 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-05-27T11:22:11+00:00Added an answer on May 27, 2026 at 11:22 am

    You have a record containing a static array. This particular record has a size equal to ElementCount*SizeOf(Element).

    Judging by the the fact that your array is sized with a MAX_POINTS constant it looks like you have a variable number of points in the array. I think I would be inclined to switch to dynamic arrays like this:

    type
      TSinglePoint = record
        x: Single;
        y: Single;
      end;
      TSinglePointArray = array of TSinglePoint;
    

    Now if you have a variable, a: TSinglePointArray, then a value of nil indicates that it is empty or nil. You can query for the length of the array with Length(a). You can resize the array with SetLength(a, NewLength).

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

Sidebar

Related Questions

I have defined the following array: m_curve = [1.32, 1.33, 1.34, 1.35, 1.36, 1.37,
I have defined a custom list template type for SharePoint . I install it
I have defined a config section in my app.config in the following way: <?xml
I have defined the following button in jqgrid. I have looked up alot of
I have defined a Matrix module as follows: module Matrix = struct type 'a
I have defined in XAML a list view, see following fragment: <Grid> <Button Content=_Generate
I have defined an array in php $letters = array(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,W,V,X,Y,Z); Then I try to
I have defined a type as: type Register = Int I'm also able to
I have defined a new content type (document) for sharepoint. The problem I have
i have defined a route culture/Controller/action/id... my controller contains following action.. [OutputCache(Duration=60*10)] public ActionResult

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.