下标必须介于1和数组大小之间

时间:2013-06-13 18:47:31

标签: crystal-reports

我收到"下标必须介于1和数组的大小之间#34;以下代码在crytal报告中。请帮忙!

'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

1 个答案:

答案 0 :(得分:1)

看起来您可能遇到与this question相同的问题。

分配变量时,请使用:=代替=,看看是否能解决问题。