Dear visitor, welcome to Jabaco - Community.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
Select Case and Brackets
I am using a Select Case to identify day of the week limitations. Jabaco gives an error for "Case 1 to 30" and Case Is > 30
Select Case Val(temp)
Case 0
cbo_HDay.ListIndex = -1
cbo_HDay.SetFocus
Exit Sub
Case 1 To 30
cbo_HDay.ListIndex = Val(temp - 1)
Case Is > 30
cbo_HDay.ListIndex = -1
cbo_HDay_LostFocus
Exit Sub
Case Else
End Select
End If
Case Else
End Select
Also, when I use round brackets I get an end of statement missing error. When I use square brackets the program compiles. My question is when do you use round or square brackets?
This works:
If Len(cbo_AuxI.Text) > 0 Then
Select Case cbo_AuxI.ListIndex
Case 4
cup[RecordNum].PM = 1 ' Square Brackets
txt_PM.Text = txt_MPM.Text
txt_GPM.Enabled = False
.......
End Select
End If
This Does not Work:
If Len(cbo_AuxI.Text) > 0 Then
Select Case cbo_AuxI.ListIndex
Case 4
cup(RecordNum).PM = 1 ' Origional VB round brackets
txt_PM.Text = txt_MPM.Text
txt_GPM.Enabled = False
.......
End Select
End If
Thank you... Ronnie
I think I have an answer for the case question and that is that JaBaco follow's java's case statement formation. There are no "To" or "Is" in the case format.