Quote:
Originally Posted by IronBits
Ok, so this works
Const strTeams = "",Free-DC,AMDUsers,ArsTechnica,.....
if Left(str_CurrentLine,5) = "user=" Then
MyArray = Split(str_CurrentLine,"=",-1,1)
Team_Name = MyArray(1)
arrMyTeamName = Split(Team_Name,"_",-1,1)
StringPos = InStr(1, strTeams, arrMyTeamName(0), vbTextCompare)
if StringPOS > 0 Then
UserName = arrMyTeamName(1)
Else
UserName = Team_Name
End If
Maybe one of you can find a cleaner way to achieve the same thing?
|
Well, If I understand what you are trying to do, then maybe the following would work for you:
Code:
If Left(str_CurrentLine,5) = "user=" Then
MyArray = Split(str_CurrentLine,"=",-1,1)
Team_Name = MyArray(1)
If InStr(1, Team_Name, "Team_", 1) > 0 Then
UserName = Right(Team_Name, Len(Team_Name)-5)
Else
UserName = Team_Name
End If
End If
One place I've found to be a valuable resource for vbscript is here:
http://www.w3schools.com/VBscript/vb..._functions.asp