Reputation: 11
i am receiving "A Subscript Must be Between 1 and the Size of the Array" for below code in crytal report. Please help!
'To Use Multiline if Basic Syntax was used
Shared Cust_Ids() As Number
Shared Page_No() As Number
Shared Cust_Ids2() As Number
Shared Page_No2() As Number
Local m As Number
Local i As Number
Local j As Number
Local Cnt As Number
j=1
i=1
Cnt=Count({CL_Index_Page_ttx.Customer_ID})
For i=1 To Cnt
If i <=1000 Then
If Cust_Ids(i) - {CL_Index_Page_ttx.Customer_ID} = 0 Then
m = Page_No(i)
i=Cnt+1
End If
Else
If Cust_Ids2(j) - {CL_Index_Page_ttx.Customer_ID} = 0 Then
m = Page_No2(j)
i=Cnt+1
Else
j=j+1
End If
End If
Next i
Formula=m
Upvotes: 0
Views: 1372
Reputation: 2830
It looks like you may have the same problem as this question.
When assigning variables, use :=
instead of =
, and see if that solves your problem.
Upvotes: 1