The following Dodgers have been smited by the JDK for their crimes against Jam:
All the girls! for picking on the JDK and damaging his already delicate self esteem!
The Basserd Who Nicked Copper's Stuff For the offense of nicking Copper's stuff. You are a tw*t, whoever you are and we all hope you get run over by a tram in Nottingham. Or Liverpool. Or whereever else they have trams!
Copper For the crime of playing with her Wii instead of her Jammie pals!
For lunch today I spent 45 minutes trying to explain why the good people of Index should refund my £180 for the sofa they collected from me yesterday. Tasty!
Are you threaening to steal my wife's shoes? Don't. They won't suit you. If I see you posting about you cross-dressing habits again, I shall have to tell you off.
Wow, if I'm going to be reprimanded to this extent, perhaps I'd better post the following:
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _ dest As Any, _ source As Any, _ ByVal bytes As Long)
Private Function ArrayDims(arr As Variant) As Long Dim ptr As Long Dim VType As Long Const VT_BYREF As Long = &H4000& CopyMemory VType, arr, 2 If Not CBool(VType And vbArray) Then Exit Function CopyMemory ptr, ByVal VarPtr(arr) + 8, 4 If (VType And VT_BYREF) Then CopyMemory ptr, ByVal ptr, 4 If ptr Then CopyMemory ArrayDims, ByVal ptr, 2 End Function
Private Function ArrayInfo(testArr As Variant) As Variant Dim i As Long, arrDms As Long Dim arrMax As Long, arrMin As Long Let arrDms = ArrayDims(testArr) If CBool(arrDms - 1) Then arrMin = LBound(testArr, 1) For i = 1 To arrDms If LBound(testArr, i) < arrMin Then arrMin = LBound(testArr, i) If UBound(testArr, i) > arrMax Then arrMax = UBound(testArr, i) Next Else: arrMin = LBound(testArr): arrMax = UBound(testArr) End If ArrayInfo = Array(arrDms, arrMin, arrMax) End Function
Sub foobar1() Dim myArr() As String, myArr2 As Variant ReDim myArr(0 To 100, 1 To 3, 4 To 7) myArr2 = ArrayInfo(myArr) MsgBox Replace("Array Dimensions: " & myArr2(0) & _ "||Minimum Element Boundary: " & myArr2(1) & _ "||Maximum Element Boundary: " & myArr2(2), "|", vbLf) End Sub
Sub foobar2() Dim myArr As Variant, myArr2 As Variant myArr = Array(1, 2, 3) myArr2 = ArrayInfo(myArr) MsgBox Replace("Array Dimensions: " & myArr2(0) & _ "||Minimum Element Boundary: " & myArr2(1) & _ "||Maximum Element Boundary: " & myArr2(2), "|", vbLf) End Sub
Sub foobar3() Dim myArr() As Byte, myArr2 As Variant myArr = StrConv("123", vbFromUnicode) myArr2 = ArrayInfo(myArr) MsgBox Replace("Array Dimensions: " & myArr2(0) & _ "||Minimum Element Boundary: " & myArr2(1) & _ "||Maximum Element Boundary: " & myArr2(2), "|", vbLf) End Sub
Sub foobar4() Dim myArr As Variant, myArr2 As Variant Let myArr = Split("1|2|3", "|") myArr2 = ArrayInfo(myArr) MsgBox Replace("Array Dimensions: " & myArr2(0) & _ "||Minimum Element Boundary: " & myArr2(1) & _ "||Maximum Element Boundary: " & myArr2(2), "|", vbLf) End Sub
Sub foobar5() Dim myArr() As String, myArr2 As Variant ReDim myArr(12 To 23, 2 To 3) myArr2 = ArrayInfo(myArr) MsgBox Replace("Array Dimensions: " & myArr2(0) & _ "||Minimum Element Boundary: " & myArr2(1) & _ "||Maximum Element Boundary: " & myArr2(2), "|", vbLf) End Sub
Bummer, pre tags aren't all they're cut out to be. And of the following?
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _ dest As Any, _ source As Any, _ ByVal bytes As Long)
Private Function ArrayDims(arr As Variant) As Long Dim ptr As Long Dim VType As Long Const VT_BYREF As Long = &H4000& CopyMemory VType, arr, 2 If Not CBool(VType And vbArray) Then Exit Function CopyMemory ptr, ByVal VarPtr(arr) + 8, 4 If (VType And VT_BYREF) Then CopyMemory ptr, ByVal ptr, 4 If ptr Then CopyMemory ArrayDims, ByVal ptr, 2 End Function
Private Function ArrayInfo(testArr As Variant) As Variant Dim i As Long, arrDms As Long Dim arrMax As Long, arrMin As Long Let arrDms = ArrayDims(testArr) If CBool(arrDms - 1) Then arrMin = LBound(testArr, 1) For i = 1 To arrDms If LBound(testArr, i) arrMax Then arrMax = UBound(testArr, i) Next Else: arrMin = LBound(testArr): arrMax = UBound(testArr) End If ArrayInfo = Array(arrDms, arrMin, arrMax) End Function
Sub foobar1() Dim myArr() As String, myArr2 As Variant ReDim myArr(0 To 100, 1 To 3, 4 To 7) myArr2 = ArrayInfo(myArr) MsgBox Replace("Array Dimensions: " & myArr2(0) & _ "||Minimum Element Boundary: " & myArr2(1) & _ "||Maximum Element Boundary: " & myArr2(2), "|", vbLf) End Sub
Sub foobar2() Dim myArr As Variant, myArr2 As Variant myArr = Array(1, 2, 3) myArr2 = ArrayInfo(myArr) MsgBox Replace("Array Dimensions: " & myArr2(0) & _ "||Minimum Element Boundary: " & myArr2(1) & _ "||Maximum Element Boundary: " & myArr2(2), "|", vbLf) End Sub
Sub foobar3() Dim myArr() As Byte, myArr2 As Variant myArr = StrConv("123", vbFromUnicode) myArr2 = ArrayInfo(myArr) MsgBox Replace("Array Dimensions: " & myArr2(0) & _ "||Minimum Element Boundary: " & myArr2(1) & _ "||Maximum Element Boundary: " & myArr2(2), "|", vbLf) End Sub
Sub foobar4() Dim myArr As Variant, myArr2 As Variant Let myArr = Split("1|2|3", "|") myArr2 = ArrayInfo(myArr) MsgBox Replace("Array Dimensions: " & myArr2(0) & _ "||Minimum Element Boundary: " & myArr2(1) & _ "||Maximum Element Boundary: " & myArr2(2), "|", vbLf) End Sub
Sub foobar5() Dim myArr() As String, myArr2 As Variant ReDim myArr(12 To 23, 2 To 3) myArr2 = ArrayInfo(myArr) MsgBox Replace("Array Dimensions: " & myArr2(0) & _ "||Minimum Element Boundary: " & myArr2(1) & _ "||Maximum Element Boundary: " & myArr2(2), "|", vbLf) End Sub