Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
ProntoScript: getHTTP() callback function
This thread has 1 response. Displaying all posts.
Post 1 made on Saturday March 10, 2018 at 07:34
sebastian
Long Time Member
Joined:
Posts:
September 2003
21
Hi,

I was playing around with the getHTTP() static method from com.philips.HttpLibrary.
The method allows to specify a callback function that is applied to the data returned by the HTTP request.

I'm looking for a way to pass through the return value of the callback function so it becomes the return value if the getHTTP() call.

I imagine something like:

button.label = getHTTP("theURL", function(data) { return data.match("/\d{1,2}/"); });

Of course, I could use a variable to store the result of data.match(), but that seems so inefficient.
Is there really no other way?

Sebastian
OP | Post 2 made on Sunday March 11, 2018 at 04:40
sebastian
Long Time Member
Joined:
Posts:
September 2003
21
Ok, I just found out that the getHTTP() method is processed asynchronously and returns before any server data has been received.
So it won't work how I imagined it.

Sebastian

Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse