Hi,
I'm trying the following and doesn't work.
Could someone have any clue?
dim arrMyShapes(1 to MxA,1 to MxB) of New Shape
Thanks
JeanM 5 7810
"Rose Alit,mon mignon" <sr******@yahoo.ca> wrote in message news:<AS********************@news20.bellglobal.com >... Hi, I'm trying the following and doesn't work. Could someone have any clue?
dim arrMyShapes(1 to MxA,1 to MxB) of New Shape
try it like this
Dim MxA As Long
Dim MxB As Long
MxA = 10
MxB = 10
Dim x&, y As Long
Dim arrMyShapes() As Shape
ReDim arrMyShapes(1 To MxA, 1 To MxB)
For x = 1 To MxA
For y = 1 To MxB
Set arrMyShapes(x, y) = New Shape
Next
Next
> > I'm trying the following and doesn't work. Could someone have any clue?
dim arrMyShapes(1 to MxA,1 to MxB) of New Shape
try it like this
Dim MxA As Long Dim MxB As Long MxA = 10 MxB = 10 Dim x&, y As Long Dim arrMyShapes() As Shape ReDim arrMyShapes(1 To MxA, 1 To MxB) For x = 1 To MxA For y = 1 To MxB Set arrMyShapes(x, y) = New Shape Next Next
VB does not like the way you are using New. Are you sure this doesn't have
to be a control array (Shape is a standard VB control) with an X/Y formula
(or Row/Col or whatever) to imitate 2D referencing?
Rick - MVP
Thank you Bob for answering...but doesn't seem to work. I got a message
saying "wrong use of NEW"
Otherwise how could i define a new shape control at runtime?
Thanks for help
"Bob Butler" <bu*******@earthlink.net> a écrit dans le message de
news:fa************************@posting.google.com ... "Rose Alit,mon mignon" <sr******@yahoo.ca> wrote in message
news:<AS********************@news20.bellglobal.com >... Hi, I'm trying the following and doesn't work. Could someone have any clue?
dim arrMyShapes(1 to MxA,1 to MxB) of New Shape
try it like this
Dim MxA As Long Dim MxB As Long MxA = 10 MxB = 10 Dim x&, y As Long Dim arrMyShapes() As Shape ReDim arrMyShapes(1 To MxA, 1 To MxB) For x = 1 To MxA For y = 1 To MxB Set arrMyShapes(x, y) = New Shape Next Next
On Tue, 30 Mar 2004 23:05:53 -0500, "Rose Alit,mon mignon"
<sr******@yahoo.ca> wrote: Thank you Bob for answering...but doesn't seem to work. I got a message saying "wrong use of NEW"
Otherwise how could i define a new shape control at runtime?
As Rick suggested, you would be wise to use a Control Array, that way
to create a new Shape at runtime you simply Load shpArray( N )
However for convenience, there is no reason why you should not have a
two dimensional Array that refers to the iterms in the Control Array
Set shpMatrix( 1, 1 ) = shpArray( 1 )
"Rose Alit,mon mignon" <sr******@yahoo.ca> wrote in message news:<Es*********************@news20.bellglobal.co m>... Thank you Bob for answering...but doesn't seem to work. I got a message saying "wrong use of NEW"
Otherwise how could i define a new shape control at runtime?
Sorry, for some reason "Shape" didn't register as a control type and I
was just assuming you had an object called 'Shape' in your app. Rick
and J French provided better responses given that you are trying to
get an array of controls. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Simon Foster |
last post by:
I have some code which attempts to convert Python arrays (tuples of
tuples of tuples...) etc. into C arrays with equivalent contents.
The prototype code is shown below.
My only question is, is...
|
by: Mizrandir |
last post by:
I'd like to subclass numarray's array. I'd like to add some methods
and override others like __init__. I don't know how to do this and
haven't found help searching the manual or the web, can...
|
by: Todd Smith |
last post by:
I have this code, but I get a runtime error that says arr isn't
set to an instance of a class. So how do I initialize an array of
objects, calling all the constructors for each thing in the array?...
|
by: TG |
last post by:
Hi there.
I am working with multi-dimensional arrays and I need to get
coordinates of the min value in it.
using myarray.argmin() returns the index in the flatten array, which is
a first...
|
by: Rolf Wester |
last post by:
Hi,
I want to concatenate two numpy arrays with shape (n1,n2) and (n1,n3)
into a single array with shape (n1,n2+n3). I guess there is an elegant
way to do this but I couldn't figure it out. So...
|
by: andy |
last post by:
Hello,
I have created a class called shape, I've then called the following
code:
shape myShape;
This then calls the default constructor for this class:
Shape::Shape( void )
|
by: Caffiend |
last post by:
Hello again! I am still having problems with the code under the title "newbie woes", but I have moved on for now to another exercise. The book has asked me to write a program that will use two...
|
by: John [H2O] |
last post by:
I'm having trouble slicing arrays:
I thought I could do the following:
Traceback (most recent call last):
File "<string>", line 1, in <string>
ValueError: shape mismatch: objects cannot be...
|
by: Terry Reedy |
last post by:
John wrote:
If these are numpy arrays, as appears, rather that array module arrays,
then the numpy list might be a better place. In any case, using 'numpy'
would have gotten the attention of...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |