VB6 Help with looping

Can anyone tell me what I'm doing wrong here.

Private Sub cmdVending_Click()

Dim IntTotal As Integer
Dim IntCnt As Integer
Dim StrPrice As String
Dim IntPos As Integer
Dim IntValue As Integer


If lstMenu.Selected(0) Then
For IntCnt = 1 To 6
If lstMenu.Selected(IntCnt) Then
IntPos = InStr(lstMenu.Selected(IntCnt), "$")
StrPrice=mid$(lstMenu.Selected(IntCnt),IntPos,Len (lstMenu.Selected(IntCnt)

IntValue = Val(StrPrice)
IntTotal = IntTotal + IntValue
Next IntCnt

Comments

  • : Can anyone tell me what I'm doing wrong here.
    :
    : Private Sub cmdVending_Click()
    :
    : Dim IntTotal As Integer
    : Dim IntCnt As Integer
    : Dim StrPrice As String
    : Dim IntPos As Integer
    : Dim IntValue As Integer
    :
    :
    : If lstMenu.Selected(0) Then
    : For IntCnt = 1 To 6
    : If lstMenu.Selected(IntCnt) Then
    : IntPos = InStr(lstMenu.Selected(IntCnt), "$")
    : StrPrice=mid$(lstMenu.Selected(IntCnt),IntPos,Len (lstMenu.Selected(IntCnt)
    :
    : IntValue = Val(StrPrice)
    : IntTotal = IntTotal + IntValue
    : Next IntCnt
    :
    :
    IntValue = Val(StrPrice)
    val("$..")=0
    Try intValue=CCur(Strprice), or else int(mid$(StrPrice,2))
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion