Re: Filter an array by content

2019-06-21 Thread J. Landman Gay via use-livecode
Mark Talluto's bug is exactly what I see. It may be related to a certain type of scripting, or a particular sequence of commands. I crashed several times in a row within a minute of a restart, so maybe the handler I was debugging was to blame. -- Jacqueline Landman Gay | jac...@hyperactivesw.co

Re: Filter an array by content

2019-06-21 Thread Bob Sneidar via use-livecode
I am using V9.0.5 rc1 and I am not having any of these kinds of debugging crashes. I rarely step over though. Almost always I step into or out of. (I think I have that right.) Bob S > On Jun 21, 2019, at 14:33 , J. Landman Gay via use-livecode > wrote: > > On 6/21/19 2:48 PM, Alex Tweedly v

Re: Filter an array by content

2019-06-21 Thread Mark Talluto via use-livecode
On Jun 21, 2019, at 2:33 PM, J. Landman Gay via use-livecode wrote: > > I see that all the time. If you step over, the dot location fixes itself at > least here. Until the crash, anyway. It doesn't crash right away, it seems to > be a cumulative thing, so you get a few chances before everythin

Re: Filter an array by content

2019-06-21 Thread J. Landman Gay via use-livecode
On 6/21/19 2:48 PM, Alex Tweedly via use-livecode wrote: On 21/06/2019 19:38, J. Landman Gay via use-livecode wrote: My only excuse is that I've been avoiding stepping through the debugger because LC has been crashing when I do that. I've sent in many crash logs but it's only recently I've dis

Re: Filter an array by content

2019-06-21 Thread Bob Sneidar via use-livecode
Yes it is in memory, but it makes me think there might be a use case for allowing the creation of a file based database. I'll update it and repost on the list. Bob S > On Jun 21, 2019, at 12:57 , Tom Glod via use-livecode > wrote: > > very good thanks for elaborating Bob...it makes sen

Re: Filter an array by content

2019-06-21 Thread Tom Glod via use-livecode
very good thanks for elaborating Bob...it makes sense that there are use cases where the library really kicks it.. esp since its an in memory database (assuming). Its a good idea, making me rethink a couple of things. On Fri, Jun 21, 2019 at 12:06 PM Alex Tweedly via use-livecode < use-li

Re: Filter an array by content

2019-06-21 Thread Alex Tweedly via use-livecode
On 21/06/2019 19:38, J. Landman Gay via use-livecode wrote: My only excuse is that I've been avoiding stepping through the debugger because LC has been crashing when I do that. I've sent in many crash logs but it's only recently I've discovered it happens only with Step Over. It's hard to bel

Re: Filter an array by content

2019-06-21 Thread J. Landman Gay via use-livecode
Found the problem. My script local was being emptied for some reason, so there was nothing to filter. After repopulating all data it worked. My only excuse is that I've been avoiding stepping through the debugger because LC has been crashing when I do that. I've sent in many crash logs but it'

Re: Filter an array by content

2019-06-21 Thread Alex Tweedly via use-livecode
Hi Bob, It sounds like your library is something I could benefit from :-) I know it's been mentioned on the list before, but I've lost track of where to get it from, and  a quick search didn't turn anything up. Could you please send a reminder (either to the list or direct to me if you prefer

Re: Filter an array by content

2019-06-21 Thread Bob Sneidar via use-livecode
Hi Tom. So the little benchmarking I did originally showed that my method was a little longer, as I still have to iterate once through the array to populate the database. Where it really shines is that you can do complex queries, as well as multiple column sorts before converting back to an ar

Re: Filter an array by content

2019-06-21 Thread Dar Scott Consulting via use-livecode
I wonder whether explicitly specifying "wildcard pattern" would fix this. (I misread your query as referring to arrays with numeric elements, not arrays with numeric keys. Thus, my fascination with the new "where" where one can use "each > 22.2". Even with your use, "where" might be interesting.

Re: Filter an array by content

2019-06-21 Thread Niggemann, Bernd via use-livecode
Am 21.06.2019 um 09:01 schrieb use-livecode-requ...@lists.runrev.com: From: "J. Landman Gay" I spoke too soon. When I tested, I hard-coded a value as the filter string. But when I use a variable, it fails as it did before. The elements of the array

Re: Filter an array by content

2019-06-21 Thread J. Landman Gay via use-livecode
I spoke too soon. When I tested, I hard-coded a value as the filter string. But when I use a variable, it fails as it did before. The elements of the array all start with a 4-character string followed by an underscore, for example: ER01_some text here My variable contains "ER01": put tVar

Re: Filter an array by content

2019-06-20 Thread J. Landman Gay via use-livecode
Thanks to all for the replies. Monte, I didn't see your post until Tom quoted it, for some reason it didn't arrive here. At any rate, I'd already tried "filter elements of..." and it failed which is why I posted. But I must have had my filter wrong because I just tried it again and it worked.

Re: Filter an array by content

2019-06-20 Thread Tom Glod via use-livecode
A great question Jacque Helpful thread all around. I have a tendency to think that any operation i perform to convert an entire array into something else will take longer than to loop through the keys. I'm happy to be wrong ,and I imagine it depends on the number of items in the dataset. But

Re: Filter an array by content

2019-06-20 Thread Monte Goulding via use-livecode
Hi Jacque, does the output also need to be a sequential numeric array? If so then no variant of the filter command will help. If not then can’t you `filter elements of theArray with “*foobar*”``? It would be a nice addition to filter elements to have `as sequence` or something so the result had

Re: Filter an array by content

2019-06-20 Thread Dar Scott Consulting via use-livecode
If LiveCode 9.5 is not applicable (since it is not released), then... If those numbers are codes taken from some small universe of codes, then maybe intersect will work: intersect affectedZipCodes with TreatedZipCodes into inspectionZipCodes But if you can go with 9.5, then maybe "where" will w

Re: Filter an array by content

2019-06-20 Thread Dar Scott Consulting via use-livecode
I think the filtering of array items was introduced in 8.1, so combine and split might not be needed. However, unless pattern matching will do, one has to wait until 9.5 to use the "where" clause in "filter". > On Jun 20, 2019, at 3:37 PM, hh via use-livecode > wrote: > > Why not "combine arr

Re: Filter an array by content

2019-06-20 Thread Bob Sneidar via use-livecode
You would have to also sort. Also, the array might not be sorted after the split. Bob S > On Jun 20, 2019, at 14:37 , hh via use-livecode > wrote: > > Why not "combine array V > filter V > split V"? > >> JLG wrote: >> I need to filter a numeric array by the content of the keys, not by the

Re: Filter an array by content

2019-06-20 Thread hh via use-livecode
Why not "combine array V > filter V > split V"? > JLG wrote: > I need to filter a numeric array by the content of the keys, not by the > keys themselves. Is there a way to do that without looping through the > entire array and looking at each element? ___

Re: Filter an array by content

2019-06-20 Thread Bob Sneidar via use-livecode
This is the perfect scenario for my arrayToDB library. Convert array to sqLite DB, query the DB using SELECT * from WHERE ORDER BY CAST( AS decimal(10.2)) then convert the resulting cursor back to an array. Contact me offlist if interested. Bob S > On Jun 20, 2019, at 13:56 , J. Landman G

Re: Filter an array by content

2019-06-20 Thread Dar Scott Consulting via use-livecode
In 9.5, perhaps, filter ... where will do it. > On Jun 20, 2019, at 2:56 PM, J. Landman Gay via use-livecode > wrote: > > I need to filter a numeric array by the content of the keys, not by the keys > themselves. Is there a way to do that without looping through the entire > array and lookin

Filter an array by content

2019-06-20 Thread J. Landman Gay via use-livecode
I need to filter a numeric array by the content of the keys, not by the keys themselves. Is there a way to do that without looping through the entire array and looking at each element? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://w