Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 131,725 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,330 people online right now. Registration is fast and FREE... Join Now!




redim in structures

 
Reply to this topicStart new topic

redim in structures, redim usage in arrays for structures

dkstevens
post 29 Nov, 2006 - 01:46 PM
Post #1


New D.I.C Head

*
Joined: 29 Nov, 2006
Posts: 1


My Contributions


My problem is this. I'm just learning vb.net after a long time in vb6 (I know, I know). I built a structure in VB6, wqrecord, that is compiled into a dll that I use as a namespace. One of the members of the structure is a double array:

dim data() as double.

I then add the .dll as a reference at define a variable as an array of structures

dim wq() as wqrecord.dll.wqrecord

In VB6 I was able to use the following

redim wq(n)
for i = 1 to n
redim wq(i).data(m)
next i

and all is well. In trying the same in vb.net, I'm not allowed to do this. What gives?

David Stevens

This post has been edited by dkstevens: 29 Nov, 2006 - 01:47 PM
User is offlineProfile CardPM

Go to the top of the page

William_Wilson
post 30 Nov, 2006 - 08:00 AM
Post #2


lost in compilation

Group Icon
Joined: 23 Dec, 2005
Posts: 3,951



Thanked 13 times

Dream Kudos: 3275

Expert In: Java, C, Javascript

My Contributions


perhaps try: redim wq(n) as wqrecord.dll.wqrecord
by including the type it may allow the redim, since it does not internally know the size of a single element of the array.

Which redim gives you the problem?
1) redim wq(n)
or
2) redim wq(i).data(m)
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/20/08 10:17AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month