Compile error

  • Thread starter Thread starter Shinichi
  • Start date Start date
S

Shinichi

Hi All!

I get an error message "Compile error: Syntax error" for
Exist(0 To 3).

I use an array "Exist(0 to 3)" in my application that gets
Boolean values (True or False) for each element.
Now, I want to test in the following code.

But it seems that "Select Case" does not take my test
expression "Exist(0 To 3)" for some reasons.
Is there any other replacement that I can use?

Any help is appriciated,

Shinichi


Select Case Exist(0 To 3)

Case Exist(0) = True And Exist(1) = True: Call
GroupingRows(ItmGrp(0), Exist(0), Exist(1), ER)
Case Exist(0) = True And Exist(1) = False: Call
GroupingRows(ItmGrp(0), Exist(0), Exist(0), ER)
Case Exist(0) = False And Exist(1) = True: Call
GroupingRows(ItmGrp(0), Exist(1), Exist(1), ER)
Case Exist(0) = False And Exist(0) = False: End Select

End Select
 
I wouldn't use a Select Case in the context. Instead, use If/Then/Else.
E.g.,

If Exist(0) = True And Exist(1) = True Then
GroupingRows(ItmGrp(0), Exist(0), Exist(1), ER)
ElseIf Exist(0) = True And Exist(1) = False Then
' whatever
ElseIf
.....
End If
 
Back
Top