comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Constant Size Array in Class Init
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Constant Size Array in Class Init [message #76238] Mon, 23 May 2011 14:27
Chris Williams is currently offline  Chris Williams
Messages: 4
Registered: May 2011
Junior Member
I am creating a class that holds multidimensional data of several
different arrays.What I am trying to do is create a class to hold the
arrays, and then define the array sizes in the init function since
they will be different sizes.

For example, I want to do something like this

FUNCTION myclass:init, dim1, dim2, dim3

myarray = dblarr(dim1, dim2, dim3)

RETURN,1
END

PRO myclass__define

void = {myclass, myarray :dblarr } ;NO SIZE ON ARRAY

RETURN
END

However, I get a conflicting data structure error without first
defining the size of the array in the procedure myclass__define. Is
there an empty array object that allows me to define the array size at
initialization and not at object creation?

Another example in JAVA,

//Class definition
class myClass(){
double myarray[][][];

//Constructor
myClass(dim1, dim2, dim3){
myarray = new double[dim1][dim2]dim3];
}

}
[Message index]
 
Read Message
Previous Topic: Re: Dealing with list created by STRSPLIT?
Next Topic: Re: Constant Size Array in Class Init

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:03:33 PDT 2025

Total time taken to generate the page: 0.00613 seconds