|
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 SArr_StrExists(SArray() As String, MyString As String, CaseSen As Boolean) As Boolean
'Function
' Used to determine if a String value is contained in an array.
'Parameters
' SArray (String()) = The array to search.
' MyString (String) = The value to search for.
' CaseSen (Boolean) = If True, the comparison is case-sensitive.
' If False, the comparison is not case-sensitive.
' In this case, if MyString is found in SArray without regard to case, function returns True.
'Return
' Returns True if the specified value (MyString) is contained in the array.
' Returns False if:
' The specified value (MyString) is not contained within the array.
' The specified array (SArray) is empty.
'Version History
' 1.0 4/1/2006 7:28am Tested by Russ Tanner on VB6 Win2000
'---
'Initiate variables
Dim i As Long 'index into SArray
'Default return value
SArr_StrExists = False
'Trap: SArray is empty, always return False
If IsEmptyArray(SArray) Then Exit Function
'Loop through all elements in the array searching for a match...
'New default return value
SArr_StrExists = True
'The search is case-sensitive
If CaseSen Then
'Loop through all items in the array. If a match is found, return True and exit.
For i = LBound(SArray) To UBound(SArray)
If MyString = SArray(i) Then Exit Function
Next i
'The search is not case-sensitive
Else
'Loop through all items in the array. If a match is found, return True and exit.
For i = LBound(SArray) To UBound(SArray)
If UCase(MyString) = UCase(SArray(i)) Then Exit Function
Next i
End If
'All items have been tested but no match was found, return False
SArr_StrExists = False
End Function
|
|
|
|
|