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

  • Home
  • SEARCH
  • 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 8722309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:23:02+00:00 2026-06-13T07:23:02+00:00

Previously i have static array for the matrix dataset design TMatrix = record row,

  • 0

Previously i have static array for the matrix dataset design

TMatrix = record
    row, column: word; {m columns ,n strings }
    Data: array[1..160, 1..160] of real

 var
 Mymatrix  : TMatrix;

 begin

 Mymatrix.row := 160; - maximum size for row us is 160 for 2 x 2 static design.
 Mymatrix.columns := 160; -  maximum size for column us is 160  for 2 x 2 static design.

With the current design i can only have 160 x 160 in 2 dimensional matrix design. If i enter more array size [1..161, 1..161] , the compiler will alert for E2100 Data type too large: exceeds 2 GB error. So if i convert the code into dynamic array , i need to re-structure all my current code to read the matrix starts from 0 . Previoulsy , for static array the array will starts from 1. Some external functions it start to read the matrix from 1.

So , now i’m stuck with my current code which i need to create more than thousand N x N matrix size . With my current static array design everything went fine if below than 160 x 160 . So , i need to get any solutions without too much to change my current static array design.

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-06-13T07:23:03+00:00Added an answer on June 13, 2026 at 7:23 am

    It’s going to be easier to continue using 1-based indexing. You can do that a few different ways. For example:

    type
      TMatrix = record
      private
        Data: array of array of Real;
        function GetRowCount: Integer;
        function GetColCount: Integer;
        function GetItem(Row, Col: Integer): Real;
        procedure SetItem(Row, Col: Integer; Value: Real);
      public      
        procedure SetSize(RowCount, ColCount: Integer);
        property RowCount: Integer read GetRowCount;
        property ColCount: Integer read GetColCount;
        property Items[Row, Col: Integer]: Real read GetItem write SetItem; default;
      end;
    
    function TMatrix.GetRowCount: Integer;
    begin
      Result := Length(Data)-1;
    end;
    
    function TMatrix.GetColCount: Integer;
    begin
      if Assigned(Data) then
        Result := Length(Data[0])-1
      else
        Result := 0;
    end;
    
    procedure TMatrix.SetSize(RowCount, ColCount: Integer);
    begin
      SetLength(Data, RowCount+1, ColCount+1);
    end;
    
    function TMatrix.GetItem(Row, Col: Integer): Real;
    begin
      Assert(InRange(Row, 1, RowCount));
      Assert(InRange(Col, 1, ColCount));
      Result := Data[Row, Col];
    end;
    
    procedure TMatrix.SetItem(Row, Col: Integer; Value: Real);
    begin
      Assert(InRange(Row, 1, RowCount));
      Assert(InRange(Col, 1, ColCount));
      Data[Row, Col] := Value;
    end;
    

    The trick here is that even though the dynamic array uses 0 based indexing, you simply ignore the values stored in the 0 index. If ever you are porting code from Fortran which uses 1-based indexing, this approach is generally the most effective.

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

Sidebar

Related Questions

I'd like to have an array of pointers to static data. For instance void
I previously have been reading NMEA data from a GPS via a serial port
I was learning Core Data and previously I have used SQLite in one of
I have a static array. private Integer[] mThumbIds = { R.drawable.sample_0, R.drawable.sample_1, R.drawable.sample_2, R.drawable.sample_3,
I have a ListView which extends BaseAdapter . I have a data[] array. The
Previously I have been investigating several solutions how to register with email address instead
I have previously written user interfaces using .NET and Windows Forms. I'm about to
I have previously read Spolsky's article on character-encoding, as well as this from dive
I have previously been told that I should always use Randomize() before I use
Suppose that we have previously instantiated three objects A, B, C from class D

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.