"[EMAIL PROTECTED]" wrote:

Sub print_matrix(xmat() As Double)
Debug.Print UBound(xmat, 1), UBound(xmat, 2)
'do stuff with xmat
End Sub

It is trivial to allocate and pass multidimensional arrays in VBA, but
C requires expertise with pointers. The subroutine print_matrix can
query the dimensions of xmat, so they don't need to be passed as
separate arguments, as in C. The fact that is tricky to do simple
things is a sign of the poor design of C

Sounds more like poor C skills on your part. Here's a snippet from the Python Imaging Library which takes a 2D array (im) and creates another one (imOut).

Imaging
ImagingRankFilter(Imaging im, int size, int rank)
{
   Imaging imOut = NULL;
   int x, y;
   int i, margin, size2;

   /* check image characteristics */
   if (!im || im->bands != 1 || im->type == IMAGING_TYPE_SPECIAL)
       return (Imaging) ImagingError_ModeError();

   /* check size of rank filter */
   if (!(size & 1))
       return (Imaging) ImagingError_ValueError("bad filter size");

   size2 = size * size;
   margin = (size-1) / 2;

   if (rank < 0 || rank >= size2)
       return (Imaging) ImagingError_ValueError("bad rank value");

   /* create output image */
   imOut = ImagingNew(im->mode, im->xsize - 2*margin, im->ysize - 2*margin);
   if (!imOut)
       return NULL;

   ... actual algorithm goes here ...

   return imOut;
}

The "im" input object carries multidimensional data, as well as all other 
properties
needed to describe the contents.  There are no separate arguments for the image
dimensions, nor any tricky pointer manipulations.  A Python version of this 
wouldn't
be much different.

</F>

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to