Date: Sun, 1 Jul 2018 15:19:34 +0000
From: Sannyasin Brahmanathaswami <bra...@hindu.org>
To: How LiveCode <use-livecode@lists.runrev.com>
Subject: Mastering TS Net
Message-ID: <c6f79403-ff07-419f-b3a0-02dfa0484...@hindu.org>
Content-Type: text/plain; charset="utf-8"
I really need to get my head around TSNet, so began experiments.
This is the documentation for tsNetGetFile
" local tHeaders, tResult
put tsNetGetFile("1", "/path/to/downloaded/file.dat", \
"ftp://user:p...@ftp.example.com/file.dat", tHeaders, \
"transferComplete") into tResult
on transferComplete pID, pResult, pBytes, pCurlCode
local tData, tHeaders
if pCurlCode is not 0 then
answer tsNetRetrError(pID)
else
a nswer "File has been downloaded"
end if
tsNetCloseConn pID
end transferComplete
# but my first attempt to "get it" ... ran into this error.
Are there any good lessons on all TSNet functions?
I am not looking forward to wading into this blind as a bat.
# variable watcher
tResult -- tsneterr: ID already in use
what is strange is this, the IDE gives the error even before tracing
the mouseup.
So I did not even get off home plate.
############
local tHeaders, tResult
on mouseup
# put a break here... the IDE show an error *before* stepping into
the next statement
# I can't even close the connection with:
tsNetCloseConn "1"
put empty into tResult
put fld aURL into pURL
put empty into fld "fldHTTPHeader"
put empty into fld "tHTMLfield"
set the itemDel to "/"
put item -1 of pURL into tFileName
put ("~/Desktop/"&tFileName) into tLocalFile
put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete")
into tResult
-- put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
end mouseup
on transferComplete pID, pResult, pBytes, pCurlCode
if pCurlCode is not 0 then
answer tsNetRetrError(pID)
else
answer "File has been downloaded"
put tHeaders into fld "fldHTTPHeader"
end if
tsNetCloseConn pID
end transferComplete
BR
Date: Sun, 01 Jul 2018 13:00:44 -0500
From: "J. Landman Gay" <jac...@hyperactivesw.com>
To: How to use LiveCode <use-livecode@lists.runrev.com>
Subject: Re: Mastering TS Net
Message-ID:
<16457010ce0.285b.5e131b4e58299f54a9f0b9c05d4f0...@hyperactivesw.com>
Content-Type: text/plain; format=flowed; charset="us-ascii"
Does TSNet even work with local files? For local files use the read/write
commands or "get/put url".
With a commercial license you shouldn't need to deal with the lower level
functions for internet communication. The basic put, post, and get commands
should do it.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On July 1, 2018 10:21:38 AM Sannyasin Brahmanathaswami via use-livecode
<use-livecode@lists.runrev.com> wrote:
tResult -- tsneterr: ID already in use
what is strange is this, the IDE gives the error even before tracing the
mouseup.
So I did not even get off home plate.
############
local tHeaders, tResult
on mouseup
# put a break here... the IDE show an error *before* stepping into the next
statement
# I can't even close the connection with:
tsNetCloseConn "1"
put empty into tResult
put fld aURL into pURL
put empty into fld "fldHTTPHeader"
put empty into fld "tHTMLfield"
set the itemDel to "/"
put item -1 of pURL into tFileName
put ("~/Desktop/"&tFileName) into tLocalFile
put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete")
into tResult
-- put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
end mouseup
on transferComplete pID, pResult, pBytes, pCurlCode
if pCurlCode is not 0 then
answer tsNetRetrError(pID)
else
answer "File has been downloaded"
put tHeaders into fld "fldHTTPHeader"
end if
tsNetCloseConn pID
end transferComplete
BR
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
------------------------------
Message: 8
Date: Mon, 2 Jul 2018 11:40:13 +1000
From: Charles Warwick <char...@techstrategies.com.au>
To: How to use LiveCode <use-livecode@lists.runrev.com>
Subject: Re: Mastering TS Net
Message-ID:
<eda5723b-6ae3-4f5b-863e-7b9a03443...@techstrategies.com.au>
Content-Type: text/plain; charset=utf-8
Hi BR,
There are a series of lessons on tsNet on the LiveCode website:
http://lessons.livecode.com/m/4071/c/235433
If you are looking for an example of how to download something
direct to a file, the lesson called ?How to asynchronously download
via SFTP directly a file? should help.
The same concepts apply for downloading to a file regardless of the
protocol being used.
If you can?t quite find an example lesson that answers what you
need, let me know and I will get one organised.
Regards,
Charles
On 2 Jul 2018, at 1:19 am, Sannyasin Brahmanathaswami via
use-livecode <use-livecode@lists.runrev.com> wrote:
I really need to get my head around TSNet, so began experiments.
This is the documentation for tsNetGetFile
" local tHeaders, tResult
put tsNetGetFile("1", "/path/to/downloaded/file.dat", \
"ftp://user:p...@ftp.example.com/file.dat", tHeaders, \
"transferComplete") into tResult
on transferComplete pID, pResult, pBytes, pCurlCode
local tData, tHeaders
if pCurlCode is not 0 then
answer tsNetRetrError(pID)
else
a nswer "File has been downloaded"
end if
tsNetCloseConn pID
end transferComplete
# but my first attempt to "get it" ... ran into this error.
Are there any good lessons on all TSNet functions?
I am not looking forward to wading into this blind as a bat.
# variable watcher
tResult -- tsneterr: ID already in use
what is strange is this, the IDE gives the error even before
tracing the mouseup.
So I did not even get off home plate.
############
local tHeaders, tResult
on mouseup
# put a break here... the IDE show an error *before* stepping into
the next statement
# I can't even close the connection with:
tsNetCloseConn "1"
put empty into tResult
put fld aURL into pURL
put empty into fld "fldHTTPHeader"
put empty into fld "tHTMLfield"
set the itemDel to "/"
put item -1 of pURL into tFileName
put ("~/Desktop/"&tFileName) into tLocalFile
put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete")
into tResult
-- put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
end mouseup
on transferComplete pID, pResult, pBytes, pCurlCode
if pCurlCode is not 0 then
answer tsNetRetrError(pID)
else
answer "File has been downloaded"
put tHeaders into fld "fldHTTPHeader"
end if
tsNetCloseConn pID
end transferComplete
BR
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
------------------------------
Message: 9
Date: Mon, 2 Jul 2018 00:45:43 -0400
From: "Ralph DiMola" <rdim...@evergreeninfo.net>
To: "'How to use LiveCode'" <use-livecode@lists.runrev.com>
Subject: RE: Sort IP List
Message-ID: <000001d411bf$8bc3aeb0$a34b0c10$@net>
Content-Type: text/plain; charset="us-ascii"
I agree "mind-bogglingly nonsensical"
Something is very odd. If I open the stack with fresh start of the IDE I
start getting results closer to what I would expect. The by ref is about 5
to 10% faster. NOW.... Every so often when I open the message box things
start getting weird and I get those crazy results. If I close msg then it is
different weird. When I say different I mean that another step in the
process starts taking longer. Close LC and restart and things are back to
normal until I open the message box a few times. No pattern as of yet. But I
do know if you don't open the message box it never goes crazy. I'm going to
dig in and see what's happening here. If I can get a recipe I'm going to
send it off to Panos.
Win 10 VM
LC 9
Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net
-----Original Message-----
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Mark Wieder via use-livecode
Sent: Saturday, June 30, 2018 11:05 PM
To: Ralph DiMola via use-livecode
Cc: Mark Wieder
Subject: Re: Sort IP List
Ralph-
Not that I'm doubting your findings, but those both seem mind-bogglingly
nonsensical to me. Can you post your test code?
--
Mark Wieder
ahsoftw...@gmail.com
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
------------------------------
Subject: Digest Footer
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-livecode
------------------------------
End of use-livecode Digest, Vol 178, Issue 2
********************************************