You are not logged in.

Ronnie

Beginner

  • "Ronnie" is male
  • "Ronnie" started this thread

Posts: 10

Date of registration: Oct 11th 2012

Location: Florida

  • Send private message

1

Thursday, October 18th 2012, 11:11pm

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

Ronnie

Beginner

  • "Ronnie" is male
  • "Ronnie" started this thread

Posts: 10

Date of registration: Oct 11th 2012

Location: Florida

  • Send private message

2

Saturday, October 20th 2012, 5:31pm

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.

Rate this thread
WoltLab Burning Board