Compile error

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
 
C

Chip Pearson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top