|
-
May 6th, 2002, 07:35 AM
#1
Thread Starter
Lively Member
Enumerate Parameters
Is is possible to enumerate parameters in a class module? I am building a COM DLL that other programmers will use and I want to make sure the variables are passed in the correct format. For instance, in the temperature example a parameter might be ConvertTo, and I want to be sure the user inputs "C" instead of Celsius. Is this possible?
-
May 7th, 2002, 04:52 AM
#2
Frenzied Member
Yes, it is possible to enumerate in a class module. However, there are some pretty stiff constraints. For a start, you can only use Longs (i.e. you can't use strings as you require in your example), and you need to set them to public if you want to pass them as arguments to procedures:
VB Code:
Public Enum TempScale
lngCelsius = 0
lngFahrenheit = 1
End Enum
Public Function DoConversion(byVal sngValue as Single, byVal ConvertTo as TempScale) as Single
'blah
End Function
-
May 7th, 2002, 06:55 AM
#3
Thread Starter
Lively Member
That worked great. Thanks.
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
|