Results 1 to 7 of 7

Thread: Stepping backward using Input #n[resolved]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member thebloke's Avatar
    Join Date
    May 2003
    Posts
    358

    Stepping backward using Input #n[resolved]

    Here's the deal. I have some code which, to cut a long story short, reads some values from a barcode scanner into an array and compares them with values in a text file.

    I have a problem in that if I get a mismatch I want to halt the process and allow the user to re-scan the barcode and compare it against the corresponding value in the text file.

    To do this, I think I need to step back in the text file (comma delimited) to ensure that the correct value is being compared.

    Here's the code I have, which works great if all values match. There is more to it but here's the bit I'm concentrating on..

    VB Code:
    1. Private Sub cmdCompare_Click()
    2. Dim arrX As Integer
    3.  
    4. cmdCompare.Enabled = False
    5.  
    6. If n = 0 Then n = 1
    7.  
    8.  
    9. If n = 1 Then
    10.     Open strinfile For Input As #1
    11. End If
    12.  
    13.         For arrX = 0 To UBound(myArray)
    14.        
    15.         Input #1, LineIn
    16.        
    17.             If LineIn = myArray(arrX) Then
    18.                 With shpGreenLight(arrX)
    19.                     .Visible = True
    20.                     .BackColor = &HC000&
    21.                     .FillColor = &HC000&
    22.                 End With
    23.             Else
    24.                 With shpGreenLight(arrX)
    25.                     .Visible = True
    26.                     .BackColor = &HFF&
    27.                     .FillColor = &HFF&
    28.                 End With
    29.                 'need to do something here
    30.                 Exit Sub
    31.             End If
    32.                
    33.         Next
    34.  
    35. If n = intfileLen Then
    36.     Close #1
    37. End If
    38.  
    39.     doCheckCards
    40.  
    41. End Sub

    Any clues?!

    Cheers
    Last edited by thebloke; Mar 31st, 2004 at 09:06 AM.
    The Bloke
    www.blokeinthekitchen.com
    making cooking cool for blokes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width