Mystical
10-26-2003, 06:53 AM
K... i am getting run-time error 6 overflow
when I press my button to refresh my online list. it refers this this code here..
intStart = InStr(intEnd + 1, strText, strStartTag, vbTextCompare)
These are the values I get. * I am wondering if the vaules add each other when I press the button each time.
intStart = 32706
intEnd = 32721
InStr(intEnd + 1, strText, strStartTag, vbTextCompare) = 32821
reboot
10-26-2003, 06:55 AM
The maximum value for an Integer is 32767. Use longs instead.
Mystical
10-26-2003, 06:58 AM
The maximum value for an Integer is 32767. Use longs instead.
Well Thank you very much, And I was dreading the response ;-) Works very well now.
Mystical
10-26-2003, 07:02 AM
Now my list1.clear doesn't work though
What I have is a little program that gets users online froma website and submits them to a listbox. Right now to update the list i have it where u need to click the button agian to get a new list.
When the variables were integers the listbox cleared and put in the new list now the listbox keeps the old list and adds the new list below that in the listbox.
Mystical
10-26-2003, 07:05 AM
Private Sub cmdLoadProfiles_Click()
Inet1.Execute "Http://www.nutrinopets.com/stats.php", "Get"
List1.Clear
Dim intStart As Long
Dim intEnd As Long
Dim strStartTag As String
Dim strEndTag As String
Dim GetText As String
Dim strUsers() As String
Dim blnDimmed As Boolean
strStartTag = "<font color=black size=2>"
strEndTag = "<"
intStart = InStr(1, strText, strStartTag, vbTextCompare)
If intStart Then
Do
intStart = intStart + Len(strStartTag)
intEnd = InStr(intStart + 1, strText, strEndTag, vbTextCompare)
GetText = Mid(strText, intStart, intEnd - intStart)
If Not blnDimmed Then
ReDim strUsers(0)
strUsers(0) = GetText
blnDimmed = True
Else
ReDim Preserve strUsers(UBound(strUsers) + 1)
strUsers(UBound(strUsers)) = GetText
List1.AddItem GetText
End If
intStart = InStr(intEnd + 1, strText, strStartTag, vbTextCompare)
Loop Until intStart = 0
End If
End Sub
reboot
10-26-2003, 07:10 AM
Changing your variables from Integer to Long would not cause your listbox not to clear.
Mystical
10-26-2003, 07:11 AM
It was working before I changed it LOL let me look threw my notes see if I changed something else too.
Mystical
10-26-2003, 07:15 AM
The only thing that I changed was
Dim intStart As Integer
Dim intEnd As Integer
to
Dim intStart As Long
Dim intEnd As Long