|
-
May 26th, 2000, 06:25 AM
#1
Thread Starter
Addicted Member
Hi,
I'm working on this program that uses plugins. I want declare and use my own publc type but I can't get it to work.
Take a look at it
Code:
Modulue1.bas
'Used to Sore Info about The Aothor of the Plugins
Public Type PLUGIN_AUTHOR
Author_Name As String
Author_Email As String
Author_Homepage As String
End Type
Code:
Plugins.cls
'This is The Plugin Class
'local variable(s) to hold property value(s)
Private mvarmnm As PLUGIN_AUTHOR 'local copy
Public Property Set Plugs(ByVal vData As PLUGIN_AUTHOR)
'used when assigning an Object to the property, on the left side of a Set statement.
'Syntax: Set x.mnm = Form1
Set mvarmnm = vData
End Property
Public Property Get Plugs() As PLUGIN_AUTHOR
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.mnm
Set Plugs = mvarmnm
End Property
I keep getting a Compiler error, any suggestions?
[Edited by omarswan on 05-26-2000 at 07:26 PM]
-
May 26th, 2000, 06:43 AM
#2
transcendental analytic
I think you have to convert your UDT to a classmodule, I've always wished there was another way.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 26th, 2000, 10:36 AM
#3
Hyperactive Member
Here is a trick:
VB will not allow you to use User Types as public in class module or pass them as parameters for functions declared on module level.
To play it around use Fried instead of public for function or properties. Theoreticaly it is not correct, but it works all right.
-
May 26th, 2000, 11:12 AM
#4
Thread Starter
Addicted Member
Any more suggestions
-
May 26th, 2000, 11:17 AM
#5
Hyperactive Member
What is wrong with Friend?
-
May 26th, 2000, 11:21 AM
#6
Hyperactive Member
And UDT are not objects so:Plugins.cls
'This is The Plugin Class
'local variable(s) to hold property value(s)
Private mvarmnm As PLUGIN_AUTHOR 'local copy
Friend Property Let Plugs(ByVal vData As PLUGIN_AUTHOR)
mvarmnm = vData
End Property
Friend Property Get Plugs() As PLUGIN_AUTHOR
Plugs = mvarmnm
End Property
This will work.
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
|