|
-
Oct 5th, 2006, 04:28 PM
#1
Thread Starter
New Member
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
-
Oct 16th, 2006, 01:44 PM
#2
Lively Member
Re: how to Create Component properties to work with ARRAYS
VB Code:
Private y() as Integer
Private Property Get getArray() As Integer()
getArray = y
End Property
Private Property Let letArray(newY() As Integer)
y = newY
End Property
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|