R
redhorse
I have created a custom class and I am able to get property procedures to
work as well as any methods that don't require any parameters. However, I
cannot seem to get a method that requires parameters to work at all.
I dhave the following methods in a class module:
Public Sub INCF()
Me.Value = currentValue + 1 'currentValue is a private property of the
class
End Sub
Public Sub BSF(ByVal i as integer)
Me.Value = i
End Sub
Note: the property procedure Value works in every other method as well as on
an instance of the class.
I can successfully call the INCF method on an instance of the class as
follows:
Reg0.INCF
When I try to use the BSF method on an instance of the class as follows:
Reg0.BSF(7)
IntelliSense will pop up and correctly show the parameters. But, after type
them in and hit enter, the code editor will separate the parenthesis from the
method name as if it is an invalid function:
Reg0.BSF (7)
If I run the code, it will generate an error stating "Invalid procedure call
or argument."
I have searched high and low for an answer to this problem, but I just can't
figure out what I am doing wrong. Everywhere I have looked seems to confirm
that I am declaring the method and calling it properly. I must be missing
something simple, but I can't for the life of me figure out what it is.
work as well as any methods that don't require any parameters. However, I
cannot seem to get a method that requires parameters to work at all.
I dhave the following methods in a class module:
Public Sub INCF()
Me.Value = currentValue + 1 'currentValue is a private property of the
class
End Sub
Public Sub BSF(ByVal i as integer)
Me.Value = i
End Sub
Note: the property procedure Value works in every other method as well as on
an instance of the class.
I can successfully call the INCF method on an instance of the class as
follows:
Reg0.INCF
When I try to use the BSF method on an instance of the class as follows:
Reg0.BSF(7)
IntelliSense will pop up and correctly show the parameters. But, after type
them in and hit enter, the code editor will separate the parenthesis from the
method name as if it is an invalid function:
Reg0.BSF (7)
If I run the code, it will generate an error stating "Invalid procedure call
or argument."
I have searched high and low for an answer to this problem, but I just can't
figure out what I am doing wrong. Everywhere I have looked seems to confirm
that I am declaring the method and calling it properly. I must be missing
something simple, but I can't for the life of me figure out what it is.