alright well I have no idea why this isn't returning a result for me can anyone see possibly why? when I post the results to label2 inside of the function it posts the correct result when I do it inside the sub where I called the function the return is "0"
VB Code:
Public Function get_text(firstword As String, secondword As String) Dim extractedtext As String Dim a As Integer Dim b As Integer Dim c As Integer a = InStr(1, HTML, firstword) b = a + Len(firstword) c = InStr(b, HTML, secondword) extractedtext = Mid$(HTML, b, c - b) extractedtext = Replace(extractedtext, "\r", "") extractedtext = Replace(extractedtext, "\t", "") extractedtext = Replace(extractedtext, "\n", "") extractedtext = Replace(extractedtext, ",", "") Label2.Caption = Int(extractedtext) End Function Private Sub Command2_Click() Dim returned_text As Integer Dim intmoney As Integer returned_text = get_text("money:", "Turn") intmoney = Int(returned_text) Label1.Caption = intmoney End Sub




Reply With Quote