Re: Numbering lines

2018-10-26 Thread Mark Hsu via use-livecode
I think your issue is where you say “put tcount & j into line tcount of it” — 
The line X of … call is very slow as it has to count every line from 1 - X.
try this:

local tBuffer
put 1 into tCount
repeat for each line j in pText
  put tCount & j & lf after tBuffer
  add 1 to tCount
  set the thumbpos of scrollbar “filterprog” to tCount
end repeat
delete line -1 of tBuffer
put tBuffer into pText //If you want to update the initial variable with the 
numbered lines
put tBuffer into field “numberedtext"

- Mark Hsu



> On Oct 26, 2018, at 10:27 AM, David V Glasgow via use-livecode 
>  wrote:
> 
> Hello folks
> 
> I am doing a content analysis of online chat and messaging.  Sometimes very 
> large files, thousands or even hundreds of thousands of messages.  I am 
> finding filter and find to be delightfully fast.
> 
> However…. Sometimes I want to prefix each line with the line number, and do 
> this:
> 
> put  1 into tcount
> repeat for each line j in it 
>  put tcount &  j into line tcount of it
>  put tcount + 1 into tcount
>  set the thumbpos of scrollbar "filterprog" to tcount
>   end repeat
>   put it into field  “numberedtext”
> 
> I use ‘it’ because of a dim memory (superstition? Myth?) from long ago that 
> it is faster than an arbitrarily named variable.  Still, the whole process is 
> pretty darned  slow.  Any brilliant suggestions?
> 
> 
> Best Wishes,
> David Glasgow
> 
> 
>  
> 
>  
> 
> ___
> 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


___
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

Re: PUT method where is returned data?

2017-02-08 Thread Mark Hsu via use-livecode
Try the urlResponse:

 PUT tJsonData into URL tURL
 
 put the urlResponse into tResult

Regards,

Mark Hsu
Canela Software
mar...@canelasoftware.com 



> On Feb 8, 2017, at 10:05 AM, Bob Hall via use-livecode 
>  wrote:
> 
> 8.1.2 Indy with Desktop App
> 
> I am using an API that uses the PUT method for some of the calls. JSON is 
> sent with server data as JSON. I can’t figure out how to access the returned 
> JSON data from the PUT call. I can not effect the API call. It's a commercial 
> SAAS application.
> 
> Here’s my snippet of code (everything is working with the PUT as far as I can 
> tell. The  data in the JSON ends up in the server App where it should). I use 
> the all caps PUT for my pea brain to understand this is a HTTP PUT method 
> request ;-)
> 
> PUT tJsonData into URL tURL
> 
> put the result into tResult
> 
> put it into tResult2
> 
> 
> I would of thought that either the result or it would have the data but both 
> are empty. If there is an error, I do see tsneterr in the result. Where do 
> can I find the response data?
> 
> Thanks in advance,
> Bob Hall
> 
> Hosting, eCommerce, Website Design,
> Custom Apps, and yes, Bicycle Repairs
> 
> 
> ___
> 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

___
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