timk777
Active Member
- Joined
- Feb 19, 2007
- Sythe Gold
- 0
- Messages
- 156
Its bloated but it works. Make sure txtInfo's multiline property is set to True.
You need:
Usage is:
Feel free to use, modify, improve on this code.
You need:
Code:
2 Textboxes- txtUser and txtInfo
1 Command button- CmdLookup
1 iNet control- InetClan
Code:
Public Function LookupClan(Person As String) As String
Dim str2() As String, TempStr() As String, StrData As String, NewStr() As String, Stuff As String, Last() As String
On Error GoTo ErrHandler
CmdLookup.Enabled = False
If InetClan.StillExecuting = True Then Exit Function
LookupClan = Split(Split(InetClan.OpenURL("http://runehead.com/feeds/lowtech/searchuser.php?user=" & Person), "@@start")(1), "@@end")(0)
StrData = InetClan.OpenURL("http://runehead.com/feeds/lowtech/searchuser.php?user=" & txtUser.Text)
str2 = Split(StrData, "@@start")
TempStr = Split(str2(1), "@@end")
If InStr(1, TempStr(0), "@@Not Found", vbTextCompare) Then
LookupClan = Person & " not found in RuneHead database."
Else
NewStr = Split(TempStr(0), "|")
Last = Split(TempStr(0), "|")
LookupClan = Replace(Stuff, vbLf, "") & "Clan Name- " & Replace(NewStr(0), vbLf, "") & vbNewLine & "Clan Site- " & Replace(Last(1), vbLf, "")
End If
CmdLookup.Enabled = True
Exit Function
ErrHandler:
CmdLookup.Enabled = True
InetClan.Cancel
MsgBox "Error Number: " & Err.Number & vbCrLf & "Error Description: " & Err.Description, vbCritical, "Clan Lookup"
Exit Function
End Function
Usage is:
Code:
TxtInfo.text = Lookupclan(txtUser.text)
Feel free to use, modify, improve on this code.

