|
1 members (Russ),
10,950
guests, and
1,516
robots. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
S |
M |
T |
W |
T |
F |
S |
|
|
|
1
|
2
|
3
|
4
|
5
|
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
|
27
|
28
|
29
|
30
|
31
|
|
|
|
|
This is another custom island. This one could be used for ads. This spot is one of the best places for ads on your site to be placed. This can be enabled/disabled on a per forum basis.
|
|
|
|
Joined: Dec 1999
Posts: 30,868
Master Elite Member
|
Public Function StrA_Mid(StrA() As String, ByVal Start As Long, ByVal Length As Long) As String()
'Purpose
' Used to parse all elements of a string array using the same method as the VB function mid().
'Parameters
' StrA (String()) = The string array we're working with.
' Start (Long) = The starting position to parse each element.
' The first character of a string is considered position 1.
' If this is 0 (zero) or negative, 1 is assumed.
' If this number is greater than the number of characters in the string,
' the particular element will be assigned a zero-length string.
' Length (Long) = The number of characters to parse from each element beginning at Start.
' If this is 0 (zero) or negative, 0 (zero) is assumed. This will return all elements as zero-length.
' If this is higher than the number of characters remaining in an element,
' all characters from Start to the end of the string are assigned to the particular element.
'Return (String())
' Returns the specified string array (StrA) with each element parsed according to the values specified.
' Returns an empty string array if:
' - The specified array (StrA) is empty.
'Version History
' 1.0 6/7/2007 3:48am Tested by Russ Tanner on VB6 SP5 Win2K Pro SP4.
'---
'Initiate variables
Dim i As Long 'iterator
Dim r() As String 'return buffer
'Trap: The specified array is empty, return an empty array
If Arr_IsEmpty(StrA) Then
StrA_Mid = r
Exit Function
End If
'Filter Error Condition: Start is zero or negative. Change this value to 1.
If Start <= 0 Then Start = 1
'Filter Error Condition: Length is negative. Change it to zero.
If Length < 0 Then Length = 0
'Transfer the specified array to the output buffer
r = StrA
'Main Loop: Loop through each element of the specified array, trimming each element
For i = LBound(r) To UBound(r)
r(i) = Mid(r(i), Start, Length)
Next i
'Return the result
StrA_Mid = r
End Function
|
|
|
|
|