put URL → strange

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Till Bandi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 12
Joined: Sun Apr 16, 2006 4:52 am

put URL → strange

Post by Till Bandi » Fri May 05, 2017 11:22 am

if I put <<put there is a url "https://www.apple.com">> into the message box I get "false"
if I put << launch "https://www.apple.com">> into the message box then the url opens correctly.

That seems strange to me. Is that a bug or is there an other way to find out if an url exists?

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: put URL → strange

Post by Klaus » Fri May 05, 2017 12:07 pm

Hi Till,

obviously URLs do not belong to the things you can check the existence of!
From the dictionary about "there is...":
...
there is a {object | file filePath | folder folderPath | process procName}
...
I would "get" or "put... into" and check hte result. This is the result from a little test I just made:
tsneterr: (6) Couldn't resolve host 'www.abcdefghijklmnopqrstuvw.com'


Best

Klaus

Till Bandi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 12
Joined: Sun Apr 16, 2006 4:52 am

Re: put URL → strange

Post by Till Bandi » Fri May 05, 2017 4:32 pm

great thanks!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9833
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: put URL → strange

Post by FourthWorld » Fri May 05, 2017 7:37 pm

Klaus wrote:obviously URLs do not belong to the things you can check the existence of!
That seems to be the case, but as long as it's going to give a value unrelated to a meaningful evaluation of the specified source (whether or not the requested resource exists), wouldn't "true" be the better answer?

After all, the url string itself is non-empty.

And even if the expression were evaluated, in all cases the value would be non-empty because at very least an error code would be the result.

Probably not worth the time to file an enhancement request for, but at the moment I side with the OP's linguistic intuition on this one.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Talking LiveCode”