Results 1 to 4 of 4

Thread: Arrays as properties

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    3

    Wink

    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.

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    3

    Question 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.


  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width