I have created two Event Definitions in a class so that I could call them from the instance of that class. I wanted to do a get/put with the same name, but that wouldn’t fly, so I created two events
valGet & valPut.
Event valGet() As Variant
Event valPut(Assigns pNewVal As Variant)
I can implement them in a child of the class, but at the place where I call them in the class, there is no problem with valGet, but I receive an “item does not exist” compile error for valPut.
I’m trying to hold my mouth right. Any suggestions?
What are you sending to valPut? Sounds like it doesn’t exist?
Hi Jym. I’m sending a variant to the event. As the custom super class is based on a Container Control, the class itself doesn’t know what control in the CC contains the value and what type of value it is (textfield, textarea, radio buttons, checkbox, textfield with a date, double, integer, etc.). This way each instance of the control can receive the variant and put it in the control where it belongs in the CC. valGet does the reverse (having the same knowledge about the controls in the CC).
Yes, I understand you are sending a Variant, but are you really? Is the variable really pointing at something? Other than that it’s impossible to guess at why it’s not working. Just change it to:
Dim v as Variant
If that works, then whatever you have in the brackets () doesn’t exist meaning you are pointing at it incorrectly.
Humm. It’s called by, and this is where I get the does not exist error:
[code]Sub Value(Assigns pnewVal As Variant)
// Part of the iFaceVal interface.
valPut = pnewVal
I’m thinking of putting the iFaceVal interface into the base that I use for the textfield, et al., and just call that.
Which doesn’t exist? valPut or pnewVal? Personally I don’t use Assigns I’d rather point at at something so I’d make a Variant as a property of the class and set that equal to whatever I need at time of execution.
It was the valPut. I deleted the Assigns and it worked. I was pretty sure I did that before, but I guess not. Not sure why it wouldn’t work with an Assigns, but whatchayougonnado?
Thanks for your help.