S
shapper
Hello,
I create a class where I have 2 properties, Name(_Name) and
Email(_Email), and one function, Subscribe.
I would like to use my class in two ways:
Dim Object As MyClass
Object.Name = "My Name"
Object.Email = "My Email"
Object.Subscribe
OR
Dim Object As MyClass
Object.Subscribe("My Name", "My Email")
How should my Subscribe function look like?
I can use:
Function Subscribe(ByVal _Name As String, ByVal _Email As String)
Dim ClassName = _Name
Dim ClassEmail = _Email
End Function
However this is allways expecting the _Name and _Email to be passed
trought the function and not through the properties.
Do I make any sense what I am trying to do?
Thanks,
Miguel
I create a class where I have 2 properties, Name(_Name) and
Email(_Email), and one function, Subscribe.
I would like to use my class in two ways:
Dim Object As MyClass
Object.Name = "My Name"
Object.Email = "My Email"
Object.Subscribe
OR
Dim Object As MyClass
Object.Subscribe("My Name", "My Email")
How should my Subscribe function look like?
I can use:
Function Subscribe(ByVal _Name As String, ByVal _Email As String)
Dim ClassName = _Name
Dim ClassEmail = _Email
End Function
However this is allways expecting the _Name and _Email to be passed
trought the function and not through the properties.
Do I make any sense what I am trying to do?
Thanks,
Miguel