Get URL anomaly
livfoss at mac.com
Mon Mar 5 07:56:12 EST 2018
Thanks to Charles Warwick I now understand that when using LC Indy versions, tsNet is automatically included both in standalones and the IDE. So, there should be no real difference between doing some simple ‘getting’ in either environment. Perhaps there isn’t, but I have run into an anomaly that I can’t understand.
As in some of my previous mails, I’m talking about having to retrieve a tiny text file from a server (and later put a modified version of it back, but let’s get one problem solved at a time) The whole thing is just a few lines of code:
constant myFileOnTheServer = "www.myserver.comm/mytextfile.txt”
put “http://“ & myFileOnTheServer into t1
get URL t1
if the result is empty then
do stuff with ‘it’, where the text file is placed
I can make this work in the IDE every time, and can verify that the text file is intact.
I can make it work in a standalone that does almost nothing more than the above, apart from filling in the odd field.
BUT in a more complex real app, the exact same code which works every time in the IDE returns an empty result (indicating ’no error’), but the file is not transferred (‘it’ is empty). Obviously I must have done something wrong, but it doesn’t appear to be the actual coding. Can it be a timing issue? Before the code is executed in my app, there is quite a bit of looking at local files on the hard disk (this is a desktop app), but I don’t see that this could have a bearing on the issue. I am logging everything, but I just can’t see what is going wrong.
It must be something I’m doing, but what?
More information about the Use-livecode