|
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 SortArray(MyArray As Variant, intSeq As Integer, intType As Integer, intKey As Integer) Dim lngLim As Long lngLim = UBound(MyArray, 1) - 1 ' array, order 1= descend, from, to, type 0 = rows, key 1=2nd col WordBasic.SortArray MyArray, intSeq, 0, lngLim, intType, intKey 'Sub TESTSortArray() 'Dim ar(3, 3) As String 'ar(0, 0) = "a" 'ar(0, 1) = "b" 'ar(0, 2) = "c" 'ar(1, 0) = "d" 'ar(1, 1) = "e" 'ar(1, 2) = "f" 'ar(2, 0) = "g" 'ar(2, 1) = "h" 'ar(2, 2) = "i" 'MsgBox ar(0, 0) 'Call SortArray(ar, 1, 0, 2) 'MsgBox ar(0, 0) 'End Sub 'Sub TESTSortRedimArray() 'Dim strar() As String 'ReDim strar(3, 0) 'strar(2, 0) = "january" 'ReDim Preserve strar(UBound(strar, 1), UBound(strar, 2) + 1) 'strar(2, 1) = "february" 'ReDim Preserve strar(UBound(strar, 1), UBound(strar, 2) + 1) 'strar(2, 2) = "march" 'ReDim Preserve strar(UBound(strar, 1), UBound(strar, 2) + 1) 'strar(2, 3) = "april" ''ReDim Preserve strAr(UBound(strAr, 1), UBound(strAr, 2) + 1) ''Selection.TypeParagraph ''Debug.Print " " ''Call DumpArray(strAr) 'Call SortRedimArray(strar, LBound(strar, 2), UBound(strar, 2), False, 2) ''Selection.TypeParagraph ''Debug.Print " " ''Call DumpArray(strAr) '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 |