🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.vcl.components.using.dotnet
Article #175

Re: multidimensional arrays from delphi to C#

#175
From: Rudy Velthuis [TeamB]
Date: Wed, 21 Sep 2005 21:13
72 lines
2935 bytes
At 22:13:52, 21.09.2005, Ankur Gupta wrote:

> Actually Rudy,
> 
> If you look at the previous post the guy is referring to, you'll notice
> that this is already mentioned.  I've managed to successfully reproduce
> the problem, and yes, it occurs when there is a type declared also.
> 
> I believe that this is a D2005 bug. Yes, one of the MANY MANY MANY bugs.

Hmmm... Looks like it indeed. 

CS file:

  using System;

  namespace CSharpClass
  {
      public class ClassOne
      {
          public static void Test1(int[,] param)
          {
          }
      }
  }

And indeed, none of the calls to Test1 below compiles:

Delphi console app:

  program MultiDimArrayTestFromCS;

  {$APPTYPE CONSOLE}

  {%DelphiDotNetAssemblyCompiler 'bin\debug\CSharpClass.dll'}

  uses
    SysUtils,
    CSharpClass;

  type
    TMultiArrayComma = array[,] of Integer;
    TMultiArrayStatic = array[0..1, 0..1] of Integer;
    TMultiArrayDynamic = array of array of Integer;

  var
    MAC: TMultiArrayComma;
    MAS: TMultiArrayStatic;
    MAD: TMultiArrayDynamic;

  begin
    MAC := New(array[,] of Integer, ((1, 2), (3, 4)));
    
    // none of these compile (E2250):

    ClassOne.Test1(MAC);
    ClassOne.Test1(New(array[,] of Integer, ((1, 2), (3, 4))));
    ClassOne.Test1(MAS);
    ClassOne.Test1(MAD);
  end.

But then why does the QC report say:

   myObject.Test1(c); // only this one works

It obviously doesn't work. 
-- 
Rudy Velthuis [TeamB]    http://velthuis.homepage.t-online.de

"First you forget names, then you forget faces. Next you forget to
 pull your zipper up and finally, you forget to pull it down."
 -- George Burns.
Technical Details
Message-ID: <xn0e7irbf8i3laa02o-velthuis@www.teamb.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <433088e9$1@newsgroups.borland.com> <xn0e7i0aj7hf8oa01x-velthuis@www.teamb.com> <4331bf00$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1f0036,fa90118e1a03503c
X-Google-Attributes: gid1f0036,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Rudy Velthuis [TeamB]" <velthuis@gmail.com>
Subject: Re: multidimensional arrays from delphi to C#
Newsgroups: borland.public.delphi.vcl.components.using.dotnet
References: <433088e9$1@newsgroups.borland.com> <xn0e7i0aj7hf8oa01x-velthuis@www.teamb.com> <4331bf00$1@newsgroups.borland.com>
Organization: TeamB
User-Agent: XanaNews/1.17.6.3
X-Realname: Rudy Velthuis (TeamB)
X-Face: "huzh55Xi]!ZNni78>a*5+).`SK?<^q2MlHk-C]Z2M9T@\J5ZCB$95Ey+s"XQuhGFA[eutZ:0^AV!Q;t>gE`1-=8d;HZ6~*o1dH<X9\b$!|(}+I'!Xq)@3Op}%0ArW&nf'Qh*EwR
Message-ID: <xn0e7irbf8i3laa02o-velthuis@www.teamb.com>
X-Ref: newsgroups.borland.com ~XNS:00007475
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 80.139.210.148
Date: 21 Sep 2005 14:13:08 -0700
X-Trace: newsgroups.borland.com 1127337188 80.139.210.148 (21 Sep 2005 14:13:08 -0700)
Lines: 72
X-Authenticated-User: rvelthuis
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail