Results 1 to 8 of 8

Thread: [RESOLVED] basic function question

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    34

    Resolved [RESOLVED] basic function question

    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:
    1. Public Function get_text(firstword As String, secondword As String)
    2. Dim extractedtext As String
    3. Dim a As Integer
    4. Dim b As Integer
    5. Dim c As Integer
    6.  
    7. a = InStr(1, HTML, firstword)
    8. b = a + Len(firstword)
    9. c = InStr(b, HTML, secondword)
    10. extractedtext = Mid$(HTML, b, c - b)
    11. extractedtext = Replace(extractedtext, "\r", "")
    12. extractedtext = Replace(extractedtext, "\t", "")
    13. extractedtext = Replace(extractedtext, "\n", "")
    14. extractedtext = Replace(extractedtext, ",", "")
    15. Label2.Caption = Int(extractedtext)
    16.  
    17. End Function
    18.  
    19. Private Sub Command2_Click()
    20. Dim returned_text As Integer
    21. Dim intmoney As Integer
    22. returned_text = get_text("money:", "Turn")
    23. intmoney = Int(returned_text)
    24. Label1.Caption = intmoney
    25. End Sub
    Last edited by pilot_kof; Jun 7th, 2006 at 07:12 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width