🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.language.delphi.dotnet
1 messages
1 total messages Started by Reinhard Hagen Sat, 21 Jun 2008 07:07
arrays-VCL-dotnet
#61
Author: Reinhard Hagen
Date: Sat, 21 Jun 2008 07:07
37 lines
1564 bytes
Hello all,

in my VCL.NET application (BDS2006) I have this code and types:

type
  CMatrix = array[,] of TComplex;  // case a)
  //TCMatrix = array of array of TComplex; // case b)

procedure MultCMatrix(const m1,m2: TCmatrix; var m3: TCmatrix);
begin
....
end;

Case a)
  Ma:=new(array[4,4] of TComplex);
  Mb:=new(array[4,4] of TComplex);
  Mc:=new(array[4,4] of TComplex);

 // then setting Ma,Mb,Mc...
// Calling

 MultCMatrix(ma,mb,mc);

causes the error:
'Object reference was not set to an instance of an object.

Case b)
  SetLength(Ma,4,4);
  SetLength(Mb,4,4);
  SetLength(Mc,4,4);

This works!

Why this difference?

Regards+Thanks
Reinhard
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads