structure with array issues

G

Guest

my program keep crashing itself it executes a structure with static array
members such as this:

module myModule:
.....
structure myStructure
.....
<VBFixedArray(8)> dim myArray() As Single
....
end structure
end module

.....in my form, let's say I would like to fill up the entire myArray with 2s
I called
for i=1 to 8
myStructure.myArray(i) = 2
next i


all of the sudden! crashed!

So I'd tried to put this in watch windows, it showed myStructure but won't
let me display myArray array, it keeps saying myArray = Nothing. Then I
tried to manually insert in values into any location, let's say:
myStructure.myArray(1) = 2. I get this warning: "Referenced 'Press' has a
value of 'Nothing'."

Could someone please tell me if there is an alternative solution to this
problem? 6.0 didn't have this issue at all. Thanks.
 
G

Guest

Wouldn't the following work;

Public Structure myStructure
....
myArray(8) as Single
End Structure
 
G

Guest

no that wouldn't work, vb.net won't allow any direct array declaration within
structure. very odd.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top