Windows 7 - Livecode 7.0.1 (rc 2)
Got a URL that is a PHP file that I call in a separate handler in an OpenStack. It posts the date/time into a MySql database table. The line of code after it "types" a sentence into a feedback field. Using the SEND: "send "TypeInfo" to me in 20 milliseconds" to enter the characters into the field. The typing pauses until the PHP URL handler finishes posting the date/time in the database. Tried post/get/put/load and all "seem" to be blocking. I might be misunderstanding this but I thought using GET would would execute its line of code and then go on to the rest of the script but it definitely waits until a response from the GET script.
Not exactly all the code but something like this:
on OpenStack
PostDateTime
put "Click the MENU button above to start." into TheInfo
TypeInfo
end OpenStack
------------------------------
on PostDateTime
GET URL ".../PostDateTime.php"
end PostDateTime
------------------------------
on TypeInfo
if InfoChar <= TotalChars then
put char InfoChar of TheInfo after field "Feedback"
send "TypeInfo" to me in 20 milliseconds
end if
end TypeInfo
Thanks for any help.
Help with URL blocking/non-blocking code
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Help with URL blocking/non-blocking code
Look at the load command
the callback message is passed 2 parameters when its called. The first is the URL in question, the second is the status, so if you have issues, check the 2nd parameter for an error.
Be aware, IOS and android work slightly different. (last time I checked) and don't cache the URL, so you must check the contents of pvar1 and pvar2 (whatever you name them..) to get the contents.
I don't have a way to explain the exact differences at the moment. Not set up for mobile on this system.
Code: Select all
on openstack
load URL "http://the.url.to.load" with "completed"
end openstack
command completed pVar1,pVar2
put URL pVar1 into <wherever you want to put it>
unload pVar1 -- free up the cached page
end completed
Be aware, IOS and android work slightly different. (last time I checked) and don't cache the URL, so you must check the contents of pvar1 and pvar2 (whatever you name them..) to get the contents.
I don't have a way to explain the exact differences at the moment. Not set up for mobile on this system.
Re: Help with URL blocking/non-blocking code
DOH. Yep, this is my week (month, year) for absent mindedness. Thx Klaus