|
-
Jun 14th, 2000, 11:20 PM
#1
Thread Starter
Junior Member
can anobody tell me whats wrong here...i get a compile error saying something like "only public defined blah blah blah"
what i am trying to do is add the type to the collection.
Private Type NameValue
lsFValue As String
lsRValue As String
End Type
Dim fcNameValue As NameValue
Dim fcCol As Collection
Dim num As Integer
Private Sub Command1_Click()
fcNameValue.lsFValue = "FVAlue"
fcNameValue.lsRValue = "RValue"
fcCol.Add fcNameValue, Str(num)
num = num + 1
End Sub
-
Jun 14th, 2000, 11:28 PM
#2
Fanatic Member
I had that exact problem just a month ago.
Solution :
Create a New Class with the class builder utility.
Add the variables that you require to this class using the class builder.
Still in class builder.
Now create a new collection of the class.
Update the project
Quite easy when you know how.
Iain, thats with an i by the way!
-
Jun 14th, 2000, 11:42 PM
#3
Thread Starter
Junior Member
thanks but wont "type " work?
thanks for that solution....but i already knew that....i was wondering if i cant do it with the "type" fellow and not the "class" fellow...
od
-
Jun 14th, 2000, 11:46 PM
#4
Fanatic Member
As far as i know, and i may be wrong, the answer is can you bollox.
I tried everything under the sun to get the type to work, but to no avail.
Maybe someone else knows though.
Iain, thats with an i by the way!
-
Jun 14th, 2000, 11:54 PM
#5
Hyperactive Member
If you're declaring using Dim, then user-defined types in Standard or Class modules will default to Public. If you intend a user-defined type to be private, make sure you declare it using the Private keyword.
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
|