mycoolfunction(<params>).<property>

tidy trax
10-23-2004, 07:07 PM
Is there a way I can make a function that has its own custom properties?

Eg: Song(c:\file.mp3).length

Edit: By property I mean the '.length' part.

Iceplug
10-23-2004, 07:10 PM
Your function has to return a UDT or a Class that has .Length as a property.
E.G.
Public Type HairStrand
HairCode As Integer
Length As Single
End Type


Public Function GetLockOfHair(Victim As String) As HairStrand
Dim H As HairStrand
'whatever.
GetLockOfHair = H
End Function

Then, you can do something like this:

Text1.Text = GetLockOfHair("Blonde").Length
:)

tidy trax
10-23-2004, 07:27 PM
Thanks for the example, but there's one thing I forgot to ask, how can I get the property that was chosen, eg: how could I tell '.length' was chosen from inside the GetLockOfHair function?

Toveling
10-23-2004, 09:11 PM
return each part of it inside your function...

Public Function GetLockOfHair(Victim As String) As HairStrand
'whatever.
getlockofhair.haircode = 93
getLockOfHair.Length = 5
End Function

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum