tsNet or not tsNet?
Graham Samuel
livfoss at mac.com
Mon Mar 5 04:21:06 EST 2018
I’ve been executing this line of script in an app made on a Mac with LC 9.0.0 dp11
get URL “http://www.myserver.com/mytextfile <http://www.myserver.com/mytextfile>.txt
It works fine, but I also wanted to detect what happens when the connection can't be established, so I made the command fail by switching off internet access on my machine. I got an error in ‘the result’, as expected. Or at least I got one when the line was executed in the IDE, and this was a tsNet error. As I had not initialised tsNet in my script - according to the dictionary, this **must** be done before tsNet functions are used - I concluded that the IDE had done it for me.
Fair enough, but I then reasoned that if I wanted to see the same kind of explicit error messages in my standalone, I would have to include a call to tsNetInit in my script. However, I created a little test app which **doesn’t** make any tsNet calls, certainly not initialising the package, but I still get a tsNet style error, e.g.
> tsneterr: (6) Could not resolve host: www.myserver.com
So, what’s going on? Is tsNet now always included in a standalone, and if so, how does it get initialised?
Puzzled, not for the first time.
Graham
More information about the use-livecode
mailing list