-
HI,
I am currently trying to create a control that will take in data using the <PARAM> tag and create graphs with it. I was wondering if there was a way create an array as a property since the number of data points will not be known and it seems rather tedius to have to make a bunch of different parameters for each data point. I noticed that a question like this was asked before and it got no replies so is there really no way to do it. Thanks for any help that is given. :)
-
Here's an example of a Property that accesses an array
Code:
Public Property Get Default(ByVal nEntry As Integer) As Double
On Error GoTo ErrorRoutine
Default = m_dDefault(nEntry)
Exit Property
ErrorRoutine:
ClassError "Default Property Get"
End Property
Public Property Let Default(ByVal nEntry As Integer, ByVal dValue As Double)
On Error GoTo ErrorRoutine
m_dDefault(nEntry) = dValue
Exit Property
ErrorRoutine:
ClassError "Default Property Let"
End Property
-
Still confused?
Hi,
Thanks for the reply to my question but I am really a novice at all of this and I don't really understand how to implement what you suggested. What exactly would be the properties that the user would be changing? Thanks for any clarification.
-
OK, I'll try to explain. The program that uses this property is used by salespeople at my company who sell telephone switching equipment. We need to make sure that the equipment is properly configured for the customer so this program asks about 100 questions and each question has a default. The defaults are stored in a database and rather than suffer the overhead of hundreds of database calls, I read the database once into a program array and from then on I access that array when I want to update or retrieve the defaults. So here is how the property works: The array is defined in a class as Private m_dDefault() as Double and when I want to build or update the array I do it through the Property Let with something like MyClass.Default(37, 1234) which would set m_dDefault(37) = 1234. That same array entry would be accessed through the Property Get with code like MyLocalValue = MyClass.Default(37).
If that doesn't help, please feel free to Email me. If and when you do, please spell out what it is that you want to do and I'll try to help.