|
-
May 3rd, 2005, 06:11 PM
#1
Thread Starter
Frenzied Member
Class Array Question
How come I have to do this..
VB Code:
Dim a7
a7 = classname.ClassVariant
a7(X, Y) = 3
classname.ClassVariant = a7
When I would like to do this
VB Code:
classname.ClassVariant(X, Y) = 3
Class variant is a variant declared as public in a class declarations area.
Its bugging me.
??
-
May 4th, 2005, 02:41 AM
#2
Thread Starter
Frenzied Member
Re: Class Array Question
If I don't use the more long winded aproach the array does not get equated. Do I have to do this because my declaration of the array in the class is..
rather than ...
VB Code:
Public ClassVariant() as Variant
?
-
May 4th, 2005, 03:29 AM
#3
Re: Class Array Question
If it doesn't allow you to do that, you will have to create a function within the class that sets the values instead:
VB Code:
'class
Public Function SetVariant(x As Integer, y As Integer, val As Integer) As Long
ClassVariant(x, y) = val
End Function
'form
classname.SetVariant x, y, 3
Or your way. I don't think there is a way around it..
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
May 4th, 2005, 05:24 AM
#4
Thread Starter
Frenzied Member
Re: Class Array Question
Which is of course the propper way of doing things. But a pain none the less. Thanks for the reminder phReAk.
-
May 4th, 2005, 05:42 AM
#5
Re: Class Array Question
Np what-so-ever. I do realise it would be easier to do it your way (the second way), but hey, I think that's what .NET is for (?)
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
May 4th, 2005, 05:48 AM
#6
Thread Starter
Frenzied Member
Re: Class Array Question
I can't help thinking that Microsoft just didn't want to finsh VB. I hate that. Here we all are trying to put out the best software we can, having to use code that needs get arounds for virtually everything you want to do.
Its a bummer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|