1.01 : HTTPRequest() UserData bug

Just starting out? Need help? Post your questions and find answers here.
Comtois
Posts: 40
Joined: Mon Feb 24, 2014 11:07 pm

1.01 : HTTPRequest() UserData bug

Post by Comtois »

Doc say UserData is an integer, and compiler say UserData should be a string :?

Code: Select all

Procedure HttpGetEvent(Success, Result$, UserData)
    If Success
      ;Debug Result$
      Debug UserData
    Else
      Debug "HTTPRequest(): Error"
    EndIf
  EndProcedure
  
  ; Get the content of this file, and display it in the debug window
  ;
  HTTPRequest(#PB_HTTP_Get, #PB_Compiler_Filename, 123, @HttpGetEvent())
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: 1.01 : HTTPRequest() UserData bug

Post by Fred »

UserData is the last field (optional), so iy should be written like this:

Code: Select all

Procedure HttpGetEvent(Success, Result$, UserData)
    If Success
      ;Debug Result$
      Debug UserData
    Else
      Debug "HTTPRequest(): Error"
    EndIf
  EndProcedure
 
  ; Get the content of this file, and display it in the debug window
  ;
  HTTPRequest(#PB_HTTP_Get, #PB_Compiler_Filename, "", @HttpGetEvent(), 123)
Comtois
Posts: 40
Joined: Mon Feb 24, 2014 11:07 pm

Re: 1.01 : HTTPRequest() UserData bug

Post by Comtois »

Ah yes, i read doc too fast :oops:
Post Reply