1.11M Members

Specific position of an integer in a string

 
0
 

Hi I'm new here. I'm making a barcode calutator and I want to know how can I get the positions of all integer in a string because I need their position for calculations. Thanks in advance

 
0
 

Additional info: I'm making an EAN 13 barcode format

So far here's the code I'm using. What I want is I will do
the inputing

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Const TEST_DATA = "8 9 0 4 0 0 0 2 1 0 0 3 C"
        Dim strParts() As String
        Dim lngIndex As Long
        Dim intTotal As Integer
        Dim intCount As Integer
        Dim intUp As Integer

        strParts = Split(TEST_DATA, " ")

        For lngIndex = UBound(strParts) - 1 To 0 Step -2
            For intCount = 1 To 3
                intTotal = intTotal + strParts(lngIndex)
            Next
        Next
        On Error Resume Next
        For lngIndex = UBound(strParts) To 0 Step -2
            intTotal = intTotal + strParts(lngIndex)
        Next
        On Error GoTo 0

        intUp = intTotal
        Do Until intUp Mod 10 = 0
            intUp = intUp + 1
        Loop

        strParts(UBound(strParts)) = intUp - intTotal

        MsgBox(Join(strParts))
    End Sub
 
0
 

Nevermind problem solved

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article