Can't get data from internet

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tomsve
Posts: 46
Joined: Tue Jan 20, 2015 5:01 pm

Can't get data from internet

Post by tomsve » Sat Mar 04, 2017 2:37 pm

Hi again,

Maybe I just forgot something here, but I simply can't get data from internet to my field.

I have a button on my card. The code for my button;

Code: Select all

on mouseUp
   load URL "host/someText.html" with message "doneLoading"
end mouseUp
The code in my card. I moved the code to the stack code as well, without success.

Code: Select all

on doneLoading
  answer "The URL is finished downloading."
end doneLoading
^^ never runs.


I've been trying to output the result into a field called "content" as well, with this code:

Code: Select all

put URL "host" into field "content"
It worked once, and I got some cryptic message in field "content" with "success" in the beginning. But after that one time - nothing.

"host" here is the whole url of course, but I'm not allowed to post URLs here in the forum it seems, not even to example. com


Any ideas of what I am doing wrong here?

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can't get data from internet

Post by Klaus » Sat Mar 04, 2017 4:36 pm

Hi Tom,

what platform and what version of LC?
SHOULD work out of the box of course!

You need to have at least 10 postings before you can post URLs and attachments here.
This is due to high spam traffic here unfortunately.


Best

Klaus

tomsve
Posts: 46
Joined: Tue Jan 20, 2015 5:01 pm

Re: Can't get data from internet

Post by tomsve » Sat Mar 04, 2017 5:32 pm

Dear Klaus,

Thanks for answering. Yes, I also expected it to work out of the box.

I'm using LiveCode 8.1.3 with xCode 8.2.1.

Btw, I managed to attach a file in my previous post regarding to get the scroller to work with data grid in iOS. That was my 3rd post I think, so I'm happy :)

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can't get data from internet

Post by Klaus » Sat Mar 04, 2017 5:38 pm

Hi Tom,

hm, very strange...

Try this:

Code: Select all

...
put URL "www.host..." into field "content"
if the result <> empty then 
   answer the result
end if
...
Maybe that ("the result" is empty on success!) will give us a little hint on what might go wrong.


Best

Klaus

tomsve
Posts: 46
Joined: Tue Jan 20, 2015 5:01 pm

Re: Can't get data from internet

Post by tomsve » Sat Mar 04, 2017 5:50 pm

I get a message box saying "error URL is currently loading". Any ideas...?

tomsve
Posts: 46
Joined: Tue Jan 20, 2015 5:01 pm

Re: Can't get data from internet

Post by tomsve » Sat Mar 04, 2017 6:00 pm

I just had a quick look in the release notes to see if there was any known issues related to internet with the release I use, but I couldn't find any. Instead, it's written "LiveCode Indy and Business editions now come with the tsNet external, which supercharges LiveCode's Internet features and performance. ".

Is there something I should do with my code to use tsNet maybe, to get it to work?

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can't get data from internet

Post by Klaus » Sat Mar 04, 2017 6:13 pm

Hi Tom,

no need to change your code, tsNet will automatically be used in the Indy and Business edition.
For the "error URL is currently loading", is this just a "small" HTML page that you try to load or some "bigger" file?

Whatever, try again after quitting and restarting LC.


Best

Klaus

Post Reply