Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.



Public Function strUnPackIKLW(ByVal strIn As String, strDelimiter As String, i1 As Integer, i2 As Integer, i3 As Integer) As String
    Dim strResult As String
    Dim str1 As String
    Dim str2 As String
    Dim str3 As String
    str1 = Trim(strSplitStringAt(strIn, strDelimiter, True)) & " "
    str2 = Trim(strSplitStringAt(strIn, strDelimiter, False))
    str3 = Trim(strSplitStringAt(str2, strDelimiter, False)) & " "
    str2 = Trim(strSplitStringAt(str2, strDelimiter, True)) & " "
    If i1 = 1 Then
        strResult = str1
    Else
        If i1 = 2 Then
            strResult = str2
        Else
            If i1 = 3 Then
                strResult = str3
            Else
                strResult = ""
            End If
        End If
    End If
    If i2 = 1 Then
        strResult = strResult & str1
    Else
        If i2 = 2 Then
            strResult = strResult & str2
        Else
            If i2 = 3 Then
                strResult = strResult & str3
            Else
            End If
        End If
    End If
    If i3 = 1 Then
        strResult = strResult & str1
    Else
        If i3 = 2 Then
            strResult = strResult & str2
        Else
            If i3 = 3 Then
                strResult = strResult & str3
            Else
            End If
        End If
    End If
    strUnPackIKLW = strResult
'Sub TESTstrUnPackIKLW()
'MsgBox strUnPackIKLW("here|is|a string", "|", 3, 1, 2) ' a string here is
'MsgBox strUnPackIKLW("here|is|a string", "|", 1, 2, 3) 'here is a string
'MsgBox strUnPackIKLW("here|is|a string", "|", 1, 0, 0) ' here
'MsgBox strUnPackIKLW("here|is|a string", "|", 1, 1, 1) ' here here here
'MsgBox strUnPackIKLW("here|is|a string", "|", 0, 0, 0) '
'End Sub
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1

Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.

Public Function strUnPackIKLW(ByVal strIn As String, strDelimiter As String, i1 As Integer, i2 As Integer, i3 As Integer) As String
    Dim strResult As String
    Dim str1 As String
    Dim str2 As String
    Dim str3 As String
    str1 = Trim(strSplitStringAt(strIn, strDelimiter, True)) & " "
    str2 = Trim(strSplitStringAt(strIn, strDelimiter, False))
    str3 = Trim(strSplitStringAt(str2, strDelimiter, False)) & " "
    str2 = Trim(strSplitStringAt(str2, strDelimiter, True)) & " "
    If i1 = 1 Then
        strResult = str1
    Else
        If i1 = 2 Then
            strResult = str2
        Else
            If i1 = 3 Then
                strResult = str3
            Else
                strResult = ""
            End If
        End If
    End If
    If i2 = 1 Then
        strResult = strResult & str1
    Else
        If i2 = 2 Then
            strResult = strResult & str2
        Else
            If i2 = 3 Then
                strResult = strResult & str3
            Else
            End If
        End If
    End If
    If i3 = 1 Then
        strResult = strResult & str1
    Else
        If i3 = 2 Then
            strResult = strResult & str2
        Else
            If i3 = 3 Then
                strResult = strResult & str3
            Else
            End If
        End If
    End If
    strUnPackIKLW = strResult
'Sub TESTstrUnPackIKLW()
'MsgBox strUnPackIKLW("here|is|a string", "|", 3, 1, 2) ' a string here is
'MsgBox strUnPackIKLW("here|is|a string", "|", 1, 2, 3) 'here is a string
'MsgBox strUnPackIKLW("here|is|a string", "|", 1, 0, 0) ' here
'MsgBox strUnPackIKLW("here|is|a string", "|", 1, 1, 1) ' here here here
'MsgBox strUnPackIKLW("here|is|a string", "|", 0, 0, 0) '
'End Sub
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1