Results 1 to 2 of 2

Thread: how to Create Component properties to work with ARRAYS

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    2

    how to Create Component properties to work with ARRAYS

    Hi,
    I am converting one active reprot to VB component and I got one situation where I need to convert the array in the report to component property to store values in the component property. How can I get and let the array values in the properties. Here is some code

    AR Report code:

    If Rpt.Pages.Count = 0 Then
    ReDim g_nPoisoningTotal(1)
    ReDim g_nHearingTotal(1)
    ReDim g_nOtherIllnessTotal(1)
    End If

    ' Make the page array bigger 5 pages at a time
    If Rpt.Pages.Count > UBound(g_nDeathTotal) Then
    ReDim Preserve g_nPoisoningTotal(nArrayBound)
    ReDim Preserve g_nHearingTotal(nArrayBound)
    ReDim Preserve g_nOtherIllnessTotal(nArrayBound)
    End If

    If (Rpt.Sections("Detail").Controls("chkPoisoning").Value) Then
    g_nPoisoningTotal(nPage) = g_nPoisoningTotal(nPage) + 1
    ElseIf (Rpt.Sections("Detail").Controls("chkHearing").Value) Then
    g_nHearingTotal(nPage) = g_nHearingTotal(nPage) + 1
    ElseIf (Rpt.Sections("Detail").Controls("chkOtherIllness").Value) Then
    g_nOtherIllnessTotal(nPage) = g_nOtherIllnessTotal(nPage) + 1
    End If


    I need to conver the above code in to VB Component as properties (g_nPoisoningTotal(), g_nHearingTotal(), g_nOtherIllnessTotal()
    ).

    Can any body help me how to create properties to deal with arryas.

    Thanks in advance.

    VBuser18

  2. #2
    Lively Member
    Join Date
    Aug 2005
    Posts
    77

    Re: how to Create Component properties to work with ARRAYS

    VB Code:
    1. Private y() as Integer
    2.  
    3. Private Property Get getArray() As Integer()
    4.     getArray = y
    5. End Property
    6.  
    7. Private Property Let letArray(newY() As Integer)
    8.     y = newY
    9. End Property
    Pieter

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