Equivalent syntax using a class ?
Can anyone enlighten me as to a class based syntax that will allow me to do the equivalent of this...
Code:
Public Type SomethingElse
Index as Long
Order as Long
Ref as String
EndType
Public Type Something
Name as String
Group() as SomethingElse
End type
Public Thing as Something
Thanks in advance
.
Re: Equivalent syntax using a class ?
The only thing that I can come up with myself is...
Code:
Something_Name As String
Something_Group As Long
' Use the Group value as an index as a pointer
' to the following one D arrays
Index() As Long
Order() As Long
Ref() As String
is there another way ?
.
Re: Equivalent syntax using a class ?
im sorry but you cant make user difened types public in class :cry: i dont know why. but i do know that it sux
1 Attachment(s)
Re: Equivalent syntax using a class ?
Not exactly what you want but maybe it will give you ideas.
Re: Equivalent syntax using a class ?
Yep - it sucks alright. I shall have to stick to Globals for my complex types then I fear. Thanks _visual_basic_
1 Attachment(s)
Re: Equivalent syntax using a class ?
I left out something(else).
Re: Equivalent syntax using a class ?
Hmm. I hadn't though of taking the next level into a different class. Thanks for the left field approach Marty.
.
Re: Equivalent syntax using a class ?
You could also probably create a collection of CSomething objects and use Name as the key to the collection.
Re: Equivalent syntax using a class ?
I am ending up doing something similar using a directory type instead of the SomethingElse class. Name will be the index within the directory (EDIT oops -I meant Dictionary) type.
BTW, Merry Christmas Marty
.
Re: Equivalent syntax using a class ?
Re: Equivalent syntax using a class ?
Dictionary is a type of collection that has better exposrure of the indexes. It happens to be faster than collections but not as fast as arrays.
Do a search of the forum. There has been some recent posts on the subject.
Re: Equivalent syntax using a class ?
Re: Equivalent syntax using a class ?
sweet...
where can i get the file that contains dictionary?
Re: Equivalent syntax using a class ?
It comes in the same reference as FSO (namely, scrrun.dll).
The syntax it is different enough from collections that you will find yourself scratching your head at the start.
But definitely a usefull tool to have in the box.
.