Re: Nasty filter bug

2024-01-24 Thread Brian Milby via use-livecode
It seems that an unmatched opening bracket makes it completely fail.  My
guess is that the filter string is not valid so it doesn't even try.  I
couldn't get a filter string containing a "[" to match anything.

On Wed, Jan 24, 2024 at 5:23 PM Craig Newman via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Brian.
>
> So the inclusion of “[“ would have matched nothing in the original string
> ""aaa[bbb””? That is, even though the bracketed string was not “closed”
> with “]”, did it try to find a string that began with “b”, failed, and
> therefore returned the original string untouched?
>
> Craig
>
> > On Jan 24, 2024, at 4:37 PM, Brian Milby via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > I just want to clarify that this isn’t the regex version of filter but
> the wildcard pattern version.  It is much less complicated than regex.
> Square brackets are used to group characters to be matched so you can use
> [abc]* to match any item that starts with a, b, or c.  The dictionary entry
> for this is pretty good.
> >
> > Brian Milby
> > br...@milby7.com <mailto:br...@milby7.com>
> >
> >> On Jan 24, 2024, at 3:35 PM, Craig Newman via use-livecode <
> use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>>
> wrote:
> >>
> >> Brian.
> >>
> >> The original post tried to filter a string by filtering (without) that
> actual string, and was interested in why that did not yield empty.
> Intuitively, the result of such a filter operation ought always to be
> empty. The presence of the char “[“ is the “culprit”. That is as far as I
> took it.
> >>
> >> Anyway, you state that the char “[“ is a regex special character, which
> explains a lot. The other two, “?” and “*” filter without issue, though,
> and I guess one has to be a regex user to see why.
> >>
> >> I am not.
> >>
> >> Craig
> >>
> >>> On Jan 24, 2024, at 2:53 PM, Brian Milby via use-livecode <
> use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>>
> wrote:
> >>>
> >>> Your test misses the actual issue:
> >>>
> >>> on mouseup
> >>> local tStr
> >>> local tFilter
> >>> put "a*b" into tFilter
> >>> put "anything bold" into tStr
> >>> filter tStr with tFilter
> >>> put tStr
> >>> end mouseup
> >>>
> >>> Will yield "anything bold"
> >>>
> >>> while using the following 2 lines:
> >>> put "a?b" into tFilter
> >>> put "a*b" into tStr
> >>> will yield "a*b"
> >>>
> >>> Finally, using the following 2 lines:
> >>> put "a[?]b" into tFilter
> >>> put "a?b" into tStr
> >>> will  yield "a?b"
> >>>
> >>> The point is that you can end up with issues if you are counting on
> "*" and
> >>> "?" to filter literally.  They don't - they are wildcards and can match
> >>> anything (multiple char or single char respectively).  The "[" is also
> >>> special.
> >>>
> >>> To ensure that your filters work properly if you do not want to use any
> >>> wildcards (i.e. match * and ? literally) would require you to change
> *, ?,
> >>> and [ to [*], [?], and [[].
> >>>
> >>>> On Wed, Jan 24, 2024 at 1:19 PM Craig Newman via use-livecode <
> >>>> use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>>
> wrote:
> >>>>
> >>>> OK, instead of working I did this:
> >>>>
> >>>> on mouseUp
> >>>>
> >>>> repeat with y = 1 to 255
> >>>>
> >>>> put "XX" & numToChar(y) & "XX"  into temp
> >>>>
> >>>> filter temp without temp
> >>>>
> >>>> if temp <> "" then put y & return after accum
> >>>>
> >>>> end repeat
> >>>>
> >>>> answer accum
> >>>>
> >>>> end mouseUp
> >>>>
> >>>> There are two characters that prevent the filter command from doing
> its
> >>>> job: ASCII 91 (“[“) and ASCII 10, the return char.
> >>>>
> >>>>
> >>>>
> >>>> Craig
> >>>>
> >>&

Re: Nasty filter bug

2024-01-24 Thread Craig Newman via use-livecode
Brian.

So the inclusion of “[“ would have matched nothing in the original string 
""aaa[bbb””? That is, even though the bracketed string was not “closed” with 
“]”, did it try to find a string that began with “b”, failed, and therefore 
returned the original string untouched?

Craig

> On Jan 24, 2024, at 4:37 PM, Brian Milby via use-livecode 
>  wrote:
> 
> I just want to clarify that this isn’t the regex version of filter but the 
> wildcard pattern version.  It is much less complicated than regex.  Square 
> brackets are used to group characters to be matched so you can use [abc]* to 
> match any item that starts with a, b, or c.  The dictionary entry for this is 
> pretty good.
> 
> Brian Milby
> br...@milby7.com <mailto:br...@milby7.com>
> 
>> On Jan 24, 2024, at 3:35 PM, Craig Newman via use-livecode 
>> mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> Brian.
>> 
>> The original post tried to filter a string by filtering (without) that 
>> actual string, and was interested in why that did not yield empty. 
>> Intuitively, the result of such a filter operation ought always to be empty. 
>> The presence of the char “[“ is the “culprit”. That is as far as I took it.
>> 
>> Anyway, you state that the char “[“ is a regex special character, which 
>> explains a lot. The other two, “?” and “*” filter without issue, though, and 
>> I guess one has to be a regex user to see why.
>> 
>> I am not.
>> 
>> Craig
>> 
>>> On Jan 24, 2024, at 2:53 PM, Brian Milby via use-livecode 
>>> mailto:use-livecode@lists.runrev.com>> 
>>> wrote:
>>> 
>>> Your test misses the actual issue:
>>> 
>>> on mouseup
>>> local tStr
>>> local tFilter
>>> put "a*b" into tFilter
>>> put "anything bold" into tStr
>>> filter tStr with tFilter
>>> put tStr
>>> end mouseup
>>> 
>>> Will yield "anything bold"
>>> 
>>> while using the following 2 lines:
>>> put "a?b" into tFilter
>>> put "a*b" into tStr
>>> will yield "a*b"
>>> 
>>> Finally, using the following 2 lines:
>>> put "a[?]b" into tFilter
>>> put "a?b" into tStr
>>> will  yield "a?b"
>>> 
>>> The point is that you can end up with issues if you are counting on "*" and
>>> "?" to filter literally.  They don't - they are wildcards and can match
>>> anything (multiple char or single char respectively).  The "[" is also
>>> special.
>>> 
>>> To ensure that your filters work properly if you do not want to use any
>>> wildcards (i.e. match * and ? literally) would require you to change *, ?,
>>> and [ to [*], [?], and [[].
>>> 
>>>> On Wed, Jan 24, 2024 at 1:19 PM Craig Newman via use-livecode <
>>>> use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>> 
>>>> wrote:
>>>> 
>>>> OK, instead of working I did this:
>>>> 
>>>> on mouseUp
>>>> 
>>>> repeat with y = 1 to 255
>>>> 
>>>> put "XX" & numToChar(y) & "XX"  into temp
>>>> 
>>>> filter temp without temp
>>>> 
>>>> if temp <> "" then put y & return after accum
>>>> 
>>>> end repeat
>>>> 
>>>> answer accum
>>>> 
>>>> end mouseUp
>>>> 
>>>> There are two characters that prevent the filter command from doing its
>>>> job: ASCII 91 (“[“) and ASCII 10, the return char.
>>>> 
>>>> 
>>>> 
>>>> Craig
>>>> 
>>>> 
>>>>> On Jan 24, 2024, at 12:51 PM, Craig Newman via use-livecode <
>>>> use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>> 
>>>> wrote:
>>>>> 
>>>>> Brian.
>>>>> 
>>>>> Nope. Those two chars pass through the filter, er, filtered.
>>>>> 
>>>>> Again, I did not test the entire character set.
>>>>> 
>>>>> Craig
>>>>> 
>>>>>> On Jan 24, 2024, at 11:05 AM, Brian Milby via use-livecode <
>>>> use-livecode@lists.runrev.com> wrote:
>>>>>> 
>>>>>> The only other two that would cause issues are ? and * which are single
>>>> 

Re: Nasty filter bug

2024-01-24 Thread Brian Milby via use-livecode
I just want to clarify that this isn’t the regex version of filter but the 
wildcard pattern version.  It is much less complicated than regex.  Square 
brackets are used to group characters to be matched so you can use [abc]* to 
match any item that starts with a, b, or c.  The dictionary entry for this is 
pretty good.

Brian Milby
br...@milby7.com

> On Jan 24, 2024, at 3:35 PM, Craig Newman via use-livecode 
>  wrote:
> 
> Brian.
> 
> The original post tried to filter a string by filtering (without) that actual 
> string, and was interested in why that did not yield empty. Intuitively, the 
> result of such a filter operation ought always to be empty. The presence of 
> the char “[“ is the “culprit”. That is as far as I took it.
> 
> Anyway, you state that the char “[“ is a regex special character, which 
> explains a lot. The other two, “?” and “*” filter without issue, though, and 
> I guess one has to be a regex user to see why.
> 
> I am not.
> 
> Craig
> 
>> On Jan 24, 2024, at 2:53 PM, Brian Milby via use-livecode 
>>  wrote:
>> 
>> Your test misses the actual issue:
>> 
>> on mouseup
>>  local tStr
>>  local tFilter
>>  put "a*b" into tFilter
>>  put "anything bold" into tStr
>>  filter tStr with tFilter
>>  put tStr
>> end mouseup
>> 
>> Will yield "anything bold"
>> 
>> while using the following 2 lines:
>>  put "a?b" into tFilter
>>  put "a*b" into tStr
>> will yield "a*b"
>> 
>> Finally, using the following 2 lines:
>>  put "a[?]b" into tFilter
>>  put "a?b" into tStr
>> will  yield "a?b"
>> 
>> The point is that you can end up with issues if you are counting on "*" and
>> "?" to filter literally.  They don't - they are wildcards and can match
>> anything (multiple char or single char respectively).  The "[" is also
>> special.
>> 
>> To ensure that your filters work properly if you do not want to use any
>> wildcards (i.e. match * and ? literally) would require you to change *, ?,
>> and [ to [*], [?], and [[].
>> 
>>> On Wed, Jan 24, 2024 at 1:19 PM Craig Newman via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>> 
>>> OK, instead of working I did this:
>>> 
>>> on mouseUp
>>> 
>>> repeat with y = 1 to 255
>>> 
>>> put "XX" & numToChar(y) & "XX"  into temp
>>> 
>>> filter temp without temp
>>> 
>>> if temp <> "" then put y & return after accum
>>> 
>>> end repeat
>>> 
>>> answer accum
>>> 
>>> end mouseUp
>>> 
>>> There are two characters that prevent the filter command from doing its
>>> job: ASCII 91 (“[“) and ASCII 10, the return char.
>>> 
>>> 
>>> 
>>> Craig
>>> 
>>> 
>>>> On Jan 24, 2024, at 12:51 PM, Craig Newman via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>>> 
>>>> Brian.
>>>> 
>>>> Nope. Those two chars pass through the filter, er, filtered.
>>>> 
>>>> Again, I did not test the entire character set.
>>>> 
>>>> Craig
>>>> 
>>>>> On Jan 24, 2024, at 11:05 AM, Brian Milby via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>>>> 
>>>>> The only other two that would cause issues are ? and * which are single
>>> and multiple char wildcards respectively.
>>>>> 
>>>>> Brian Milby
>>>>> br...@milby7.com
>>>>> 
>>>>>> On Jan 24, 2024, at 10:21 AM, Craig Newman via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>>>>> 
>>>>>> I did not test the ASCII set exhaustively, but the culprit is the
>>> char “[“ (ASCII 91). Any other char (including “]”) in the string works
>>> correctly, that is, nothing is left after the filter command executes.
>>>>>> 
>>>>>> I do not know enough to say whether that particular char  does
>>> something to the filter command, which may use regex somehow in its inner
>>> workings.
>>>>>> 
>>>>>> Craig
>>>>>> 
>>>>>> Craig
>>>>>> 
>>>>>>> On Jan 23, 2024, at 9:45 PM, Brian Milby via use-livecode <
>>> use-live

Re: Nasty filter bug (not)

2024-01-24 Thread Neville Smythe via use-livecode
Thanks Brian of putting me right (once again) . I had completely forgotten.the 
escape sequence for the wildcards is [*] and [? (an unexpected way to escape a 
character, but it is what it is) and so had overlooked that [ is itself a 
special character.

And neither * nor ? In the msg box example cause the so-called “bug” but for 
accidental reasons since they happen to match themselves, so they didn’t 
trigger my memory to look further for an explanation!

Neville Smythe




___
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: Nasty filter bug

2024-01-24 Thread Craig Newman via use-livecode
Brian.

The original post tried to filter a string by filtering (without) that actual 
string, and was interested in why that did not yield empty. Intuitively, the 
result of such a filter operation ought always to be empty. The presence of the 
char “[“ is the “culprit”. That is as far as I took it.

Anyway, you state that the char “[“ is a regex special character, which 
explains a lot. The other two, “?” and “*” filter without issue, though, and I 
guess one has to be a regex user to see why.

I am not.

Craig

> On Jan 24, 2024, at 2:53 PM, Brian Milby via use-livecode 
>  wrote:
> 
> Your test misses the actual issue:
> 
> on mouseup
>   local tStr
>   local tFilter
>   put "a*b" into tFilter
>   put "anything bold" into tStr
>   filter tStr with tFilter
>   put tStr
> end mouseup
> 
> Will yield "anything bold"
> 
> while using the following 2 lines:
>   put "a?b" into tFilter
>   put "a*b" into tStr
> will yield "a*b"
> 
> Finally, using the following 2 lines:
>   put "a[?]b" into tFilter
>   put "a?b" into tStr
> will  yield "a?b"
> 
> The point is that you can end up with issues if you are counting on "*" and
> "?" to filter literally.  They don't - they are wildcards and can match
> anything (multiple char or single char respectively).  The "[" is also
> special.
> 
> To ensure that your filters work properly if you do not want to use any
> wildcards (i.e. match * and ? literally) would require you to change *, ?,
> and [ to [*], [?], and [[].
> 
> On Wed, Jan 24, 2024 at 1:19 PM Craig Newman via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> OK, instead of working I did this:
>> 
>> on mouseUp
>> 
>> repeat with y = 1 to 255
>> 
>> put "XX" & numToChar(y) & "XX"  into temp
>> 
>> filter temp without temp
>> 
>> if temp <> "" then put y & return after accum
>> 
>> end repeat
>> 
>> answer accum
>> 
>> end mouseUp
>> 
>> There are two characters that prevent the filter command from doing its
>> job: ASCII 91 (“[“) and ASCII 10, the return char.
>> 
>> 
>> 
>> Craig
>> 
>> 
>>> On Jan 24, 2024, at 12:51 PM, Craig Newman via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>> 
>>> Brian.
>>> 
>>> Nope. Those two chars pass through the filter, er, filtered.
>>> 
>>> Again, I did not test the entire character set.
>>> 
>>> Craig
>>> 
>>>> On Jan 24, 2024, at 11:05 AM, Brian Milby via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>>> 
>>>> The only other two that would cause issues are ? and * which are single
>> and multiple char wildcards respectively.
>>>> 
>>>> Brian Milby
>>>> br...@milby7.com
>>>> 
>>>>> On Jan 24, 2024, at 10:21 AM, Craig Newman via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>>>> 
>>>>> I did not test the ASCII set exhaustively, but the culprit is the
>> char “[“ (ASCII 91). Any other char (including “]”) in the string works
>> correctly, that is, nothing is left after the filter command executes.
>>>>> 
>>>>> I do not know enough to say whether that particular char  does
>> something to the filter command, which may use regex somehow in its inner
>> workings.
>>>>> 
>>>>> Craig
>>>>> 
>>>>> Craig
>>>>> 
>>>>>> On Jan 23, 2024, at 9:45 PM, Brian Milby via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>>>>> 
>>>>>> Not sure this is really a bug.  The default is to match a
>> wildcardPattern.  If you want to match [ then you must use [[] in the
>> pattern.
>>>>>> 
>>>>>> Brian Milby
>>>>>> br...@milby7.com
>>>>>> 
>>>>>>>> On Jan 23, 2024, at 9:02 PM, Neville Smythe via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>>>>>> 
>>>>>>> Try this in the msg box:
>>>>>>> 
>>>>>>> put "aaa[bbb" into tStr; put line 1 of tStr into tLine; filter tStr
>> without tLine; put tStr
>>>>>>> I get (using MacOS, LC 9.6.11)
>>>>>>> 
>>>>>>> aaa[bbb
>>>>

Re: Nasty filter bug

2024-01-24 Thread Brian Milby via use-livecode
Your test misses the actual issue:

on mouseup
   local tStr
   local tFilter
   put "a*b" into tFilter
   put "anything bold" into tStr
   filter tStr with tFilter
   put tStr
end mouseup

Will yield "anything bold"

while using the following 2 lines:
   put "a?b" into tFilter
   put "a*b" into tStr
will yield "a*b"

Finally, using the following 2 lines:
   put "a[?]b" into tFilter
   put "a?b" into tStr
will  yield "a?b"

The point is that you can end up with issues if you are counting on "*" and
"?" to filter literally.  They don't - they are wildcards and can match
anything (multiple char or single char respectively).  The "[" is also
special.

To ensure that your filters work properly if you do not want to use any
wildcards (i.e. match * and ? literally) would require you to change *, ?,
and [ to [*], [?], and [[].

On Wed, Jan 24, 2024 at 1:19 PM Craig Newman via use-livecode <
use-livecode@lists.runrev.com> wrote:

> OK, instead of working I did this:
>
> on mouseUp
>
> repeat with y = 1 to 255
>
> put "XX" & numToChar(y) & "XX"  into temp
>
> filter temp without temp
>
> if temp <> "" then put y & return after accum
>
> end repeat
>
> answer accum
>
> end mouseUp
>
> There are two characters that prevent the filter command from doing its
> job: ASCII 91 (“[“) and ASCII 10, the return char.
>
>
>
> Craig
>
>
> > On Jan 24, 2024, at 12:51 PM, Craig Newman via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Brian.
> >
> > Nope. Those two chars pass through the filter, er, filtered.
> >
> > Again, I did not test the entire character set.
> >
> > Craig
> >
> >> On Jan 24, 2024, at 11:05 AM, Brian Milby via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>
> >> The only other two that would cause issues are ? and * which are single
> and multiple char wildcards respectively.
> >>
> >> Brian Milby
> >> br...@milby7.com
> >>
> >>> On Jan 24, 2024, at 10:21 AM, Craig Newman via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>>
> >>> I did not test the ASCII set exhaustively, but the culprit is the
> char “[“ (ASCII 91). Any other char (including “]”) in the string works
> correctly, that is, nothing is left after the filter command executes.
> >>>
> >>> I do not know enough to say whether that particular char  does
> something to the filter command, which may use regex somehow in its inner
> workings.
> >>>
> >>> Craig
> >>>
> >>> Craig
> >>>
> >>>> On Jan 23, 2024, at 9:45 PM, Brian Milby via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>>>
> >>>> Not sure this is really a bug.  The default is to match a
> wildcardPattern.  If you want to match [ then you must use [[] in the
> pattern.
> >>>>
> >>>> Brian Milby
> >>>> br...@milby7.com
> >>>>
> >>>>>> On Jan 23, 2024, at 9:02 PM, Neville Smythe via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>>>>
> >>>>> Try this in the msg box:
> >>>>>
> >>>>> put "aaa[bbb" into tStr; put line 1 of tStr into tLine; filter tStr
> without tLine; put tStr
> >>>>> I get (using MacOS, LC 9.6.11)
> >>>>>
> >>>>> aaa[bbb
> >>>>>
> >>>>> That is to say, the line is not filtered out.
> >>>>>
> >>>>> And:
> >>>>>
> >>>>> put "aaa[bbb" into tStr; filter tStr with tStr; put tStr
> >>>>>
> >>>>> produces an empty string instead of the original string.
> >>>>>
> >>>>> The bug occurs if the line contains the character “[“ anywhere; any
> lines containing that character are ignored by both filter with and filter
> without.
> >>>>>
> >>>>> This is really serious, because I rely on the filter command a lot,
> as I would think do many other developers!
> >>>>>
> >>>>> Don’t know if it occurs with other characters, but I have never seen
> it before. I discovered it when filtering lines with regular expressions.
> Other special regexp characters I have tested do not trigger the bug.
> >>>>>
> >>>>> Nevi

Re: Nasty filter bug

2024-01-24 Thread Craig Newman via use-livecode
OK, instead of working I did this:

on mouseUp

repeat with y = 1 to 255

put "XX" & numToChar(y) & "XX"  into temp

filter temp without temp

if temp <> "" then put y & return after accum

end repeat

answer accum

end mouseUp

There are two characters that prevent the filter command from doing its job: 
ASCII 91 (“[“) and ASCII 10, the return char.



Craig


> On Jan 24, 2024, at 12:51 PM, Craig Newman via use-livecode 
>  wrote:
> 
> Brian.
> 
> Nope. Those two chars pass through the filter, er, filtered.
> 
> Again, I did not test the entire character set.
> 
> Craig
> 
>> On Jan 24, 2024, at 11:05 AM, Brian Milby via use-livecode 
>>  wrote:
>> 
>> The only other two that would cause issues are ? and * which are single and 
>> multiple char wildcards respectively.
>> 
>> Brian Milby
>> br...@milby7.com
>> 
>>> On Jan 24, 2024, at 10:21 AM, Craig Newman via use-livecode 
>>>  wrote:
>>> 
>>> I did not test the ASCII set exhaustively, but the culprit is the char “[“ 
>>> (ASCII 91). Any other char (including “]”) in the string works correctly, 
>>> that is, nothing is left after the filter command executes.
>>> 
>>> I do not know enough to say whether that particular char  does something to 
>>> the filter command, which may use regex somehow in its inner workings.
>>> 
>>> Craig
>>> 
>>> Craig
>>> 
>>>> On Jan 23, 2024, at 9:45 PM, Brian Milby via use-livecode 
>>>>  wrote:
>>>> 
>>>> Not sure this is really a bug.  The default is to match a wildcardPattern. 
>>>>  If you want to match [ then you must use [[] in the pattern.
>>>> 
>>>> Brian Milby
>>>> br...@milby7.com
>>>> 
>>>>>> On Jan 23, 2024, at 9:02 PM, Neville Smythe via use-livecode 
>>>>>>  wrote:
>>>>> 
>>>>> Try this in the msg box:
>>>>> 
>>>>> put "aaa[bbb" into tStr; put line 1 of tStr into tLine; filter tStr 
>>>>> without tLine; put tStr
>>>>> I get (using MacOS, LC 9.6.11)
>>>>> 
>>>>> aaa[bbb
>>>>> 
>>>>> That is to say, the line is not filtered out.
>>>>> 
>>>>> And:
>>>>> 
>>>>> put "aaa[bbb" into tStr; filter tStr with tStr; put tStr
>>>>> 
>>>>> produces an empty string instead of the original string.
>>>>> 
>>>>> The bug occurs if the line contains the character “[“ anywhere; any lines 
>>>>> containing that character are ignored by both filter with and filter 
>>>>> without.
>>>>> 
>>>>> This is really serious, because I rely on the filter command a lot, as I 
>>>>> would think do many other developers!
>>>>> 
>>>>> Don’t know if it occurs with other characters, but I have never seen it 
>>>>> before. I discovered it when filtering lines with regular expressions. 
>>>>> Other special regexp characters I have tested do not trigger the bug.
>>>>> 
>>>>> Neville Smythe
>>>>> 
>>>>> 
>>>>> 
>>>>> ___
>>>>> 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
>>> 
>>> 
>>> ___
>>> 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
> 
> 
> ___
> 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: Nasty filter bug

2024-01-24 Thread Craig Newman via use-livecode
Brian.

Nope. Those two chars pass through the filter, er, filtered.

Again, I did not test the entire character set.

Craig

> On Jan 24, 2024, at 11:05 AM, Brian Milby via use-livecode 
>  wrote:
> 
> The only other two that would cause issues are ? and * which are single and 
> multiple char wildcards respectively.
> 
> Brian Milby
> br...@milby7.com
> 
>> On Jan 24, 2024, at 10:21 AM, Craig Newman via use-livecode 
>>  wrote:
>> 
>> I did not test the ASCII set exhaustively, but the culprit is the char “[“ 
>> (ASCII 91). Any other char (including “]”) in the string works correctly, 
>> that is, nothing is left after the filter command executes.
>> 
>> I do not know enough to say whether that particular char  does something to 
>> the filter command, which may use regex somehow in its inner workings.
>> 
>> Craig
>> 
>> Craig
>> 
>>> On Jan 23, 2024, at 9:45 PM, Brian Milby via use-livecode 
>>>  wrote:
>>> 
>>> Not sure this is really a bug.  The default is to match a wildcardPattern.  
>>> If you want to match [ then you must use [[] in the pattern.
>>> 
>>> Brian Milby
>>> br...@milby7.com
>>> 
>>>>> On Jan 23, 2024, at 9:02 PM, Neville Smythe via use-livecode 
>>>>>  wrote:
>>>> 
>>>> Try this in the msg box:
>>>> 
>>>> put "aaa[bbb" into tStr; put line 1 of tStr into tLine; filter tStr 
>>>> without tLine; put tStr
>>>> I get (using MacOS, LC 9.6.11)
>>>> 
>>>> aaa[bbb
>>>> 
>>>> That is to say, the line is not filtered out.
>>>> 
>>>> And:
>>>> 
>>>> put "aaa[bbb" into tStr; filter tStr with tStr; put tStr
>>>> 
>>>> produces an empty string instead of the original string.
>>>> 
>>>> The bug occurs if the line contains the character “[“ anywhere; any lines 
>>>> containing that character are ignored by both filter with and filter 
>>>> without.
>>>> 
>>>> This is really serious, because I rely on the filter command a lot, as I 
>>>> would think do many other developers!
>>>> 
>>>> Don’t know if it occurs with other characters, but I have never seen it 
>>>> before. I discovered it when filtering lines with regular expressions. 
>>>> Other special regexp characters I have tested do not trigger the bug.
>>>> 
>>>> Neville Smythe
>>>> 
>>>> 
>>>> 
>>>> ___
>>>> 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
>> 
>> 
>> ___
>> 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


___
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: Nasty filter bug

2024-01-24 Thread Brian Milby via use-livecode
The only other two that would cause issues are ? and * which are single and 
multiple char wildcards respectively.

Brian Milby
br...@milby7.com

> On Jan 24, 2024, at 10:21 AM, Craig Newman via use-livecode 
>  wrote:
> 
> I did not test the ASCII set exhaustively, but the culprit is the char “[“ 
> (ASCII 91). Any other char (including “]”) in the string works correctly, 
> that is, nothing is left after the filter command executes.
> 
> I do not know enough to say whether that particular char  does something to 
> the filter command, which may use regex somehow in its inner workings.
> 
> Craig
> 
> Craig
> 
>> On Jan 23, 2024, at 9:45 PM, Brian Milby via use-livecode 
>>  wrote:
>> 
>> Not sure this is really a bug.  The default is to match a wildcardPattern.  
>> If you want to match [ then you must use [[] in the pattern.
>> 
>> Brian Milby
>> br...@milby7.com
>> 
>>>> On Jan 23, 2024, at 9:02 PM, Neville Smythe via use-livecode 
>>>>  wrote:
>>> 
>>> Try this in the msg box:
>>> 
>>> put "aaa[bbb" into tStr; put line 1 of tStr into tLine; filter tStr without 
>>> tLine; put tStr
>>> I get (using MacOS, LC 9.6.11)
>>> 
>>> aaa[bbb
>>> 
>>> That is to say, the line is not filtered out.
>>> 
>>> And:
>>> 
>>> put "aaa[bbb" into tStr; filter tStr with tStr; put tStr
>>> 
>>> produces an empty string instead of the original string.
>>> 
>>> The bug occurs if the line contains the character “[“ anywhere; any lines 
>>> containing that character are ignored by both filter with and filter 
>>> without.
>>> 
>>> This is really serious, because I rely on the filter command a lot, as I 
>>> would think do many other developers!
>>> 
>>> Don’t know if it occurs with other characters, but I have never seen it 
>>> before. I discovered it when filtering lines with regular expressions. 
>>> Other special regexp characters I have tested do not trigger the bug.
>>> 
>>> Neville Smythe
>>> 
>>> 
>>> 
>>> ___
>>> 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
> 
> 
> ___
> 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: Nasty filter bug

2024-01-24 Thread Craig Newman via use-livecode
I did not test the ASCII set exhaustively, but the culprit is the char “[“ 
(ASCII 91). Any other char (including “]”) in the string works correctly, that 
is, nothing is left after the filter command executes.

I do not know enough to say whether that particular char  does something to the 
filter command, which may use regex somehow in its inner workings.

Craig

Craig

> On Jan 23, 2024, at 9:45 PM, Brian Milby via use-livecode 
>  wrote:
> 
> Not sure this is really a bug.  The default is to match a wildcardPattern.  
> If you want to match [ then you must use [[] in the pattern.
> 
> Brian Milby
> br...@milby7.com
> 
>> On Jan 23, 2024, at 9:02 PM, Neville Smythe via use-livecode 
>>  wrote:
>> 
>> Try this in the msg box:
>> 
>> put "aaa[bbb" into tStr; put line 1 of tStr into tLine; filter tStr without 
>> tLine; put tStr
>> I get (using MacOS, LC 9.6.11)
>> 
>> aaa[bbb
>> 
>> That is to say, the line is not filtered out.
>> 
>> And:
>> 
>> put "aaa[bbb" into tStr; filter tStr with tStr; put tStr
>> 
>> produces an empty string instead of the original string.
>> 
>> The bug occurs if the line contains the character “[“ anywhere; any lines 
>> containing that character are ignored by both filter with and filter without.
>> 
>> This is really serious, because I rely on the filter command a lot, as I 
>> would think do many other developers!
>> 
>> Don’t know if it occurs with other characters, but I have never seen it 
>> before. I discovered it when filtering lines with regular expressions. Other 
>> special regexp characters I have tested do not trigger the bug.
>> 
>> Neville Smythe
>> 
>> 
>> 
>> ___
>> 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


___
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: Nasty filter bug

2024-01-23 Thread Brian Milby via use-livecode
Not sure this is really a bug.  The default is to match a wildcardPattern.  If 
you want to match [ then you must use [[] in the pattern.

Brian Milby
br...@milby7.com

> On Jan 23, 2024, at 9:02 PM, Neville Smythe via use-livecode 
>  wrote:
> 
> Try this in the msg box:
> 
> put "aaa[bbb" into tStr; put line 1 of tStr into tLine; filter tStr without 
> tLine; put tStr
> I get (using MacOS, LC 9.6.11)
> 
> aaa[bbb
> 
> That is to say, the line is not filtered out.
> 
> And:
> 
> put "aaa[bbb" into tStr; filter tStr with tStr; put tStr
> 
> produces an empty string instead of the original string.
> 
> The bug occurs if the line contains the character “[“ anywhere; any lines 
> containing that character are ignored by both filter with and filter without.
> 
> This is really serious, because I rely on the filter command a lot, as I 
> would think do many other developers!
> 
> Don’t know if it occurs with other characters, but I have never seen it 
> before. I discovered it when filtering lines with regular expressions. Other 
> special regexp characters I have tested do not trigger the bug.
> 
> Neville Smythe
> 
> 
> 
> ___
> 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


Nasty filter bug

2024-01-23 Thread Neville Smythe via use-livecode
Try this in the msg box:

put "aaa[bbb" into tStr; put line 1 of tStr into tLine; filter tStr without 
tLine; put tStr
I get (using MacOS, LC 9.6.11)

aaa[bbb

That is to say, the line is not filtered out.

And:

put "aaa[bbb" into tStr; filter tStr with tStr; put tStr

produces an empty string instead of the original string.

The bug occurs if the line contains the character “[“ anywhere; any lines 
containing that character are ignored by both filter with and filter without.

This is really serious, because I rely on the filter command a lot, as I would 
think do many other developers!

Don’t know if it occurs with other characters, but I have never seen it before. 
I discovered it when filtering lines with regular expressions. Other special 
regexp characters I have tested do not trigger the bug.

Neville Smythe



___
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: Filter with wildcards

2023-11-02 Thread Neville Smythe via use-livecode
Users should certainly never see regex! That’s covered in User  Interface 
Guidelines 101.

But surely you wouldn’t show them the LC wildcard filter either!

$@%?$@%?$@%?$@%?$@%?$@%?$@%?$@%?
Neville Smythe
Director, International Go Federation
VicePresident, Australian Go Association Inc.

> On 3 Nov 2023, at 12:02 am, David Glasgow  wrote:
> 
> 
> 
>> On 1 Nov 2023, at 11:24 pm, Neville Smythe  
>> wrote:
>> 
>> But I suspect you should allow for the required strings to be followed by 
>> punctuation or be at the end of the line, things which are hard to do with a 
>> simple LC wildcard search, at least in a single filter. 
> 
> 
> When I originally went down the wildcard route, I wrote some gentle text 
> preprocessing (using replace) to make sure words are always bounded by a 
> space, including before punctuation and at an eol.
> 
> I also need users to see the reason  the message appears in the results (i.e 
> the matched filter) so  they are listed under a heading consisting of the 
> search term.  Not sure what users would make of regex!
> 
> Thanks again,
> 
> Cheers
> 
> David G
___
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: Filter with wildcards

2023-11-02 Thread David Glasgow via use-livecode



> On 1 Nov 2023, at 11:24 pm, Neville Smythe  
> wrote:
> 
> But I suspect you should allow for the required strings to be followed by 
> punctuation or be at the end of the line, things which are hard to do with a 
> simple LC wildcard search, at least in a single filter. 


When I originally went down the wildcard route, I wrote some gentle text 
preprocessing (using replace) to make sure words are always bounded by a space, 
including before punctuation and at an eol.

I also need users to see the reason  the message appears in the results (i.e 
the matched filter) so  they are listed under a heading consisting of the 
search term.  Not sure what users would make of regex!

Thanks again,

Cheers

David G
___
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: Filter with wildcards

2023-11-01 Thread Neville Smythe via use-livecode
I agree David, regular expressions look intimidating at first sight. But in 
fact if you compare your intuitive attempt

filter tList with “*with [you,u] *”

with the regex which does what you set out to do

filter tList with regex “.*with (you|u) .*”

they are almost exactly the same – for very good reasons of course. The . is 
just the regex for a single character, the * says “any number incuding 0 of the 
preceding pattern”.

I don’t know your actual use-case, the above may be enough for all your 
searches, But I suspect you should allow for the required strings to be 
followed by punctuation or be at the end of the line, things which are hard to 
do with a simple LC wildcard search, at least in a single filter. 

The final tweak to account for a case insensitive search adds a flag at the 
front the of the regex (and I agree is rather arcane). If you want arcane, 
there is a possibly  better way to do the regex search for either the whole 
word “you" or the whole word “u”. You can use the code “\b” to indicate  a word 
boundary instead of a character, that is white space, punctuation or line start 
or end. 

filter tList with regex “.*with\b(you|u)\b.*”

As usual with a complex language there are alternative ways of accomplishing 
the same thing. Hmm, if to be truthful, my previous regex doesn’t do precisely 
the same thing as looking for word boundaries (hyphens, numbers, hard 
spaces…human language is so complicated).

I opine that regular expressions and sql are the two most useful technologies 
to add to the LC developer’s toolbox. After some basic user interface design 
principles course. Beyond those lie the web languages html, css, javascript 
(shudder). And then LCB, something I have yet to tackle.

BTW, apologies for the “numeric” when I meant “alphabetic” in the previous 
email. It seems I cannot write an email these days without at leat one mistke.

Neville

> On 1 Nov 2023, at 7:54 pm, David V Glasgow  wrote:
> 
> This is the thing about regex, amazing,powerful, impressive, but scary as 
> hell.
> 
> I will play with this a little, though… so thanks for your time when you 
> should have been doing something else.  I appreciate it. 
> 
> Best Wishes,
> 
> David Glasgow
> Consultant Forensic & Clinical Psychologist
> Carlton Glasgow Partnership
> Director, Child & Family Training, York
> Honorary Professor (SOCAMRU), Nottingham Trent University
> 
> LinkedIn Profile
> 
>> On 31 Oct 2023, at 8:59 pm, Neville Smythe via use-livecode 
>> mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> Forgot any number of other chars after the non-numeric character
>> 
>> Filter tList with regex "(?i).*with (you|u)([^a-zA-Z].*|$)”
>> 
>> Now I’ve really got to go … hope I’ve got it all right this time! 
>> 
>> Neville Smythe




___
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: Filter with wildcards

2023-11-01 Thread David V Glasgow via use-livecode
This is the thing about regex, amazing,powerful, impressive, but scary as hell.

I will play with this a little, though… so thanks for your time when you should 
have been doing something else.  I appreciate it. 

Best Wishes,

David Glasgow
Consultant Forensic & Clinical Psychologist
Carlton Glasgow Partnership
Director, Child & Family Training, York
Honorary Professor (SOCAMRU), Nottingham Trent University

LinkedIn Profile

> On 31 Oct 2023, at 8:59 pm, Neville Smythe via use-livecode 
>  wrote:
> 
> Forgot any number of other chars after the non-numeric character
> 
> Filter tList with regex "(?i).*with (you|u)([^a-zA-Z].*|$)”
> 
> Now I’ve really got to go … hope I’ve got it all right this time! 
> 
> Neville Smythe
> 
> 
> 
> 
> ___
> 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: Filter with wildcards

2023-11-01 Thread David Glasgow via use-livecode
Thanks all for the suggestions, folks.

I expected someone to mention regex (shudder).  I have many searches in a loop 
and most are simple strings, so excepting regex filters would be a bit of a 
pain (unless of course I could specify regex but this would not choke if the 
search was simple string containing no regular expressions)

Because I am lazy, and a simple soul, I will probably just  split the task into 
two filter commands - which will deliver exactly what I want at only a minimal 
time and thought overhead.

Cheers

David G

> On 30 Oct 2023, at 7:29 pm, Mark Waddingham via use-livecode 
>  wrote:
> 
> The filter command has had a ‘with[out] regex’ form for a long time - so I’d 
> use a regex instead :)
> 
> (I’m pretty sure [ ] is a set of characters to match, rather than a list of 
> sub strings, in wildcard expressions)
> 
> Warmest Regards,
> 
> Mark.
> 
> Sent from my iPhone
> 
>> On 30 Oct 2023, at 17:19, David Glasgow via use-livecode 
>>  wrote:
>> 
>> Hi folks,
>> 
>> I am doing the above and struggling with an oddity that I can’t find 
>> guidance on on Livecode or wider wildcard stuff
>> 
>> A simple example is I am searching text messages for 'with you' or 'with u’
>> 
>> so I use the wildcard form
>> 
>> *with [you,u]*
>> 
>> That finds all examples of both just fine.  However, it also finds ‘with 
>> unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
>> both u
>> 
>> When I put two spaces inside the square brackets after each string, the 
>> search still works but spaces seem to be ignored (so still finds the above 
>> resamples I don’t want).
>> 
>> If I put a single space after the brackets the first bracketed string is 
>> ignored and the filter only finds “with u “
>> 
>> Hope someone can help me stop pulling my baffled face
>> 
>> Cheers
>> 
>> 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


___
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: Filter with wildcards

2023-10-31 Thread Neville Smythe via use-livecode
Forgot any number of other chars after the non-numeric character

Filter tList with regex "(?i).*with (you|u)([^a-zA-Z].*|$)”

Now I’ve really got to go … hope I’ve got it all right this time! 

Neville Smythe




___
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: Filter with wildcards

2023-10-31 Thread Neville Smythe via use-livecode
Filter tList with regex "(?i).*with (you|u)( .*|\.|$)"

I did forget something … wth you might be folllowed by a comma or colon or 
something so the last brackets should search for either any non alphabetic 
character or the end of line, so think (going from memory here)

Filter tList with regex "(?i).*with (you|u)([^a-zA-Z]|$)”


Neville Smythe




___
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: Filter with wildcards

2023-10-31 Thread Neville Smythe via use-livecode
Reglar expressions is definitely the way to go

So you want to catch any number of characters
.*
Followed by the string “with “
.*with 
Followed by either “you” or “u”
.*with (you|u)
Followed by a space and then any umber of characters, giving
.*with (you|u) .*

Except you might want to look for lines ending in with you, or a period
.*with (you|u)( .*|\.|$)

And what about “With You”. Since regex is case sensitive by default 
(?i).*with (you|u)( .*|\.|$)

Filter tList with regex "(?i).*with (you|u)( .*|\.|$)"

Writing this in a rush so I hope I haven’t got that wrong

Neville Smythe




___
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: Filter with wildcards

2023-10-30 Thread Mark Waddingham via use-livecode
The filter command has had a ‘with[out] regex’ form for a long time - so I’d 
use a regex instead :)

(I’m pretty sure [ ] is a set of characters to match, rather than a list of sub 
strings, in wildcard expressions)

Warmest Regards,

Mark.

Sent from my iPhone

> On 30 Oct 2023, at 17:19, David Glasgow via use-livecode 
>  wrote:
> 
> Hi folks,
> 
> I am doing the above and struggling with an oddity that I can’t find guidance 
> on on Livecode or wider wildcard stuff
> 
> A simple example is I am searching text messages for 'with you' or 'with u’
> 
> so I use the wildcard form
> 
> *with [you,u]*
> 
> That finds all examples of both just fine.  However, it also finds ‘with 
> unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
> both u
> 
> When I put two spaces inside the square brackets after each string, the 
> search still works but spaces seem to be ignored (so still finds the above 
> resamples I don’t want).
> 
> If I put a single space after the brackets the first bracketed string is 
> ignored and the filter only finds “with u “
> 
> Hope someone can help me stop pulling my baffled face
> 
> Cheers
> 
> 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: Filter with wildcards

2023-10-30 Thread Richmond Mathewson via use-livecode

I think that matchText is what you are looking for.

I have a proof stack which I shall upload to the forums, as obviously 
this is not possible here:


https://forums.livecode.com/viewtopic.php?f=7=38698

Best, Richmond Mathewson.

On 30.10.23 19:17, David Glasgow via use-livecode wrote:

Hi folks,

I am doing the above and struggling with an oddity that I can’t find guidance 
on on Livecode or wider wildcard stuff

A simple example is I am searching text messages for 'with you' or 'with u’

so I use the wildcard form

*with [you,u]*

That finds all examples of both just fine.  However, it also finds ‘with 
unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
both u

When I put two spaces inside the square brackets after each string, the search 
still works but spaces seem to be ignored (so still finds the above resamples I 
don’t want).

If I put a single space after the brackets the first bracketed string is 
ignored and the filter only finds “with u “

Hope someone can help me stop pulling my baffled face

Cheers

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: Filter with wildcards

2023-10-30 Thread Richmond Mathewson via use-livecode
Oddly enough a matchChunk expression with "with you$" pulls out all the 
'with you' stuff and excludes this sort of thing: 'with youthful 
naivety' . . . which is marvellous


But a matchChunk expression with "with u$" catches nothing!

On 30.10.23 20:11, Craig Newman via use-livecode wrote:

Have not played with a method of keeping it all in one line. But can you filter 
twice, storing the first result and then running it again?

Craig


On Oct 30, 2023, at 1:17 PM, David Glasgow via use-livecode 
 wrote:

Hi folks,

I am doing the above and struggling with an oddity that I can’t find guidance 
on on Livecode or wider wildcard stuff

A simple example is I am searching text messages for 'with you' or 'with u’

so I use the wildcard form

*with [you,u]*

That finds all examples of both just fine.  However, it also finds ‘with 
unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
both u

When I put two spaces inside the square brackets after each string, the search 
still works but spaces seem to be ignored (so still finds the above resamples I 
don’t want).

If I put a single space after the brackets the first bracketed string is 
ignored and the filter only finds “with u “

Hope someone can help me stop pulling my baffled face

Cheers

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


___
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: Filter with wildcards

2023-10-30 Thread Richmond Mathewson via use-livecode

OK: well I had a bash with a set like this:

with unlimited cheese

with you

with u

with udders clagged with glaur

with youthful naivety

and your filter grabbed all of them. :(

I tried this:

with"with [you, u,]*"

and got the same.

On reading in the dictionary I found this:

filtertVar with"[az]*"-- tVar contains all property names beginning with 
a or z


and the problematic phrase is 'beginning with'.

On 30.10.23 19:17, David Glasgow via use-livecode wrote:

Hi folks,

I am doing the above and struggling with an oddity that I can’t find guidance 
on on Livecode or wider wildcard stuff

A simple example is I am searching text messages for 'with you' or 'with u’

so I use the wildcard form

*with [you,u]*

That finds all examples of both just fine.  However, it also finds ‘with 
unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
both u

When I put two spaces inside the square brackets after each string, the search 
still works but spaces seem to be ignored (so still finds the above resamples I 
don’t want).

If I put a single space after the brackets the first bracketed string is 
ignored and the filter only finds “with u “

Hope someone can help me stop pulling my baffled face

Cheers

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: Filter with wildcards

2023-10-30 Thread Craig Newman via use-livecode
Have not played with a method of keeping it all in one line. But can you filter 
twice, storing the first result and then running it again?

Craig

> On Oct 30, 2023, at 1:17 PM, David Glasgow via use-livecode 
>  wrote:
> 
> Hi folks,
> 
> I am doing the above and struggling with an oddity that I can’t find guidance 
> on on Livecode or wider wildcard stuff
> 
> A simple example is I am searching text messages for 'with you' or 'with u’
> 
> so I use the wildcard form
> 
> *with [you,u]*
> 
> That finds all examples of both just fine.  However, it also finds ‘with 
> unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
> both u
> 
> When I put two spaces inside the square brackets after each string, the 
> search still works but spaces seem to be ignored (so still finds the above 
> resamples I don’t want).
> 
> If I put a single space after the brackets the first bracketed string is 
> ignored and the filter only finds “with u “
> 
> Hope someone can help me stop pulling my baffled face
> 
> Cheers
> 
> 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


Filter with wildcards

2023-10-30 Thread David Glasgow via use-livecode
Hi folks,

I am doing the above and struggling with an oddity that I can’t find guidance 
on on Livecode or wider wildcard stuff

A simple example is I am searching text messages for 'with you' or 'with u’

so I use the wildcard form

*with [you,u]*

That finds all examples of both just fine.  However, it also finds ‘with 
unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
both u

When I put two spaces inside the square brackets after each string, the search 
still works but spaces seem to be ignored (so still finds the above resamples I 
don’t want).

If I put a single space after the brackets the first bracketed string is 
ignored and the filter only finds “with u “

Hope someone can help me stop pulling my baffled face

Cheers

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


Re: can I filter lines with a list of alternative OR strings?

2022-03-21 Thread David V Glasgow via use-livecode
Thanks, Dick!  I’ll play with that and see how I get on.  The filter is in a 
loop which mostly uses simple strings, so presumably I would need to separate 
any regex filters into a separate loop using 'with regex'.

I have also learned that this is called “alternation”.  Didn’t know that, so 
now I can investigate further! 

thanks again

David G

> On 6 Mar 2022, at 11:12 pm, Dick Kriesel via use-livecode 
>  wrote:
> 
> 
>> On Mar 3, 2022, at 2:30 AM, David V Glasgow via use-livecode 
>>  wrote:
>> 
>> I can filter text using a single term plus a numerical range s eg:
>> *re 1[0-5]*
>> matching a text stem “re “ followed by any one of 10, 11, 12, 13, 14 or 15 
>> 
>> But is there a form where the alternatives are also text?  eg something like:
>> 
>> *big [“dog”, “cat”, “fish”]*
> 
> Hi, David.
> 
> regex supports alternation, so if you put "big dog|big fish" into tTarget 
> then you can
> 
> filter pText with regex tTarget
> 
> 
> Does that work for you?
> 
> — Dick
> ___
> 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: Speaking of Filter and Match...

2022-03-15 Thread Neville Smythe via use-livecode
I just ran a speed test on Dick Kriesel’s method for removing duplicates and 
keeping the original sort order. It is indeed faster than Jacque’s method

Sorting 11000 lines of text including 1000 duplicated lines:

Jacque’s method: 2.807 seconds [lineoffset is really slow, and in effect the 
text is scanned 3 times]

Kriesel method:  0.017 seconds

Bu what really made my eyes pop — unless I am doing something wrong, it is 
faster than using the accepted wisdom of just using “split  by cr as set; put 
the keys” method of removing duplicates and leaving the text unsorted

Split as set, don’t care about sort order method: 0.024 seconds

I can’t see anything wrong with my code, but can someone independently confirm 
this??

Neville
___
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: Speaking of Filter and Match...

2022-03-15 Thread J. Landman Gay via use-livecode

Good idea, thanks Dick. Your scripts are always so elegant.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On March 14, 2022 7:11:13 PM Dick Kriesel via use-livecode 
 wrote:


Since order must be maintained, it’s probably faster not to split and sort, 
and faster not to scan the list repeatedly using lineOffset or contains.

You could do it like this:

command removeDuplicates pDelimitedList, pDelimiter
  local tArray, tList
  set the lineDelimiter to pDelimiter
  repeat for each line tLine in pDelimitedList
 if not tArray[tLine] then -- i.e., if this line hasn't appeared already, 
 then ...

put true into tArray[tLine]
put tLine & pDelimiter after tList
 end if
  end repeat
  delete last char of tList
  return tList for value
end removeDuplicates

— Dick





___
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: Speaking of Filter and Match...

2022-03-15 Thread Roger Guay via use-livecode
Hi Dick

Thank you so much for your time in sending me this solution. I’ve already 
learned a lot and I have yet to actually play with it!

Cheers,
Roger

> On Mar 14, 2022, at 5:08 PM, Dick Kriesel via use-livecode 
>  wrote:
> 
> 
> 
>> On Mar 13, 2022, at 1:05 PM, J. Landman Gay via use-livecode 
>>  wrote:
>> 
>> On 3/12/22 8:54 PM, Roger Guay via use-livecode wrote:
>>> I have a field with about a thousand lines with many duplicate lines, and I 
>>> want to delete the duplicates. Seems like this should be simple but I am 
>>> running around in circles. Can anyone help me with this?
>> 
>> Making the list into an array is the easiest way but as mentioned, it will 
>> destroy the original order. If the order is important then you can restore 
>> it with a custom sort function...
>> 
> 
> 
> Since order must be maintained, it’s probably faster not to split and sort, 
> and faster not to scan the list repeatedly using lineOffset or contains.
> You could do it like this:
> 
> command removeDuplicates pDelimitedList, pDelimiter
>   local tArray, tList
>   set the lineDelimiter to pDelimiter
>   repeat for each line tLine in pDelimitedList
>  if not tArray[tLine] then -- i.e., if this line hasn't appeared already, 
> then ...
> put true into tArray[tLine]
> put tLine & pDelimiter after tList
>  end if
>   end repeat
>   delete last char of tList
>   return tList for value
> end removeDuplicates
> 
> — Dick
> ___
> 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: Speaking of Filter and Match...

2022-03-14 Thread Dick Kriesel via use-livecode


> On Mar 13, 2022, at 1:05 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 3/12/22 8:54 PM, Roger Guay via use-livecode wrote:
>> I have a field with about a thousand lines with many duplicate lines, and I 
>> want to delete the duplicates. Seems like this should be simple but I am 
>> running around in circles. Can anyone help me with this?
> 
> Making the list into an array is the easiest way but as mentioned, it will 
> destroy the original order. If the order is important then you can restore it 
> with a custom sort function...
> 


Since order must be maintained, it’s probably faster not to split and sort, and 
faster not to scan the list repeatedly using lineOffset or contains.
You could do it like this:

command removeDuplicates pDelimitedList, pDelimiter
   local tArray, tList
   set the lineDelimiter to pDelimiter
   repeat for each line tLine in pDelimitedList
  if not tArray[tLine] then -- i.e., if this line hasn't appeared already, 
then ...
 put true into tArray[tLine]
 put tLine & pDelimiter after tList
  end if
   end repeat
   delete last char of tList
   return tList for value
end removeDuplicates

— Dick
___
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: Speaking of Filter and Match...

2022-03-14 Thread Roger Guay via use-livecode
Ah, I see. Thank you again, Bob.

Roger

> On Mar 14, 2022, at 2:37 PM, Bob Sneidar via use-livecode 
>  wrote:
> 
> The UNIQUE clause is the UNIQUE combination of ALL the columns put together. 
> If I used: 
> 
> SELECT city,state UNIQUE FROM zip codes where state = 'CA' 
> 
> I would get every unique city/state combination in CA, whereas if I used: 
> 
> SELECT state UNIQUE from zip codes where state = 'CA'
> 
> I would get the first record matching 'CA', that is one record. 
> 
> There is a way to get the city and state for the one record (why anyone would 
> want to I don't know) by creating a join to the same table and using the 
> UNIQUE clause in the join. I am not that good at join syntax, so I won't 
> attempt it here and embarrass myself. :-)
> 
> BTW you can get the last matching record by doing an ascending sort and using 
> LIMIT 1, but I think MS SQL suffers from not having a limit clause. Not sure 
> why. Instead you use the TOP clause. 
> 
> Bob S
> 
> 
>> On Mar 14, 2022, at 12:14 , Roger Guay via use-livecode 
>>  wrote:
>> 
>>> Actually I must correct myself. That will not work because the unique value 
>>> column (typically an autoincrementing integer) will not be unique for each 
>>> record. Instead, assuming your lines of text are in a column called 
>>> "textdata" 
>>> 
>>> SELECT textdata UNIQUE FROM...
>>> 
>>> Bob S
> 
> 
> ___
> 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: Speaking of Filter and Match...

2022-03-14 Thread Bob Sneidar via use-livecode
The UNIQUE clause is the UNIQUE combination of ALL the columns put together. If 
I used: 

SELECT city,state UNIQUE FROM zip codes where state = 'CA' 

I would get every unique city/state combination in CA, whereas if I used: 

SELECT state UNIQUE from zip codes where state = 'CA'

I would get the first record matching 'CA', that is one record. 

There is a way to get the city and state for the one record (why anyone would 
want to I don't know) by creating a join to the same table and using the UNIQUE 
clause in the join. I am not that good at join syntax, so I won't attempt it 
here and embarrass myself. :-)

BTW you can get the last matching record by doing an ascending sort and using 
LIMIT 1, but I think MS SQL suffers from not having a limit clause. Not sure 
why. Instead you use the TOP clause. 

Bob S


> On Mar 14, 2022, at 12:14 , Roger Guay via use-livecode 
>  wrote:
> 
>> Actually I must correct myself. That will not work because the unique value 
>> column (typically an autoincrementing integer) will not be unique for each 
>> record. Instead, assuming your lines of text are in a column called 
>> "textdata" 
>> 
>> SELECT textdata UNIQUE FROM...
>> 
>> Bob S


___
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: Speaking of Filter and Match...

2022-03-14 Thread Roger Guay via use-livecode
Thanks ver much for your clarifications, Bob although I’m not sure I understand 
your correction.

Roger

> On Mar 14, 2022, at 8:48 AM, Bob Sneidar via use-livecode 
>  wrote:
> 
> Actually I must correct myself. That will not work because the unique value 
> column (typically an autoincrementing integer) will not be unique for each 
> record. Instead, assuming your lines of text are in a column called 
> "textdata" 
> 
> SELECT textdata UNIQUE FROM...
> 
> Bob S
> 
> 
>> On Mar 14, 2022, at 08:29 , Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> They depend on the fact that arrays cannot have duplicate keys. Dumping the 
>> data into an SQL database and querying using the UNIQUE statement would do 
>> it too. 
>> 
>> SELECT * UNIQUE from ...
>> 
>> Bob S
>> 
>> 
>> 
>>> On Mar 13, 2022, at 13:16 , Roger Guay via use-livecode 
>>>  wrote:
>>> 
>>> Thank you Jacqueline, Alex and Terry. Very interesting new (for me) methods 
>>> that I would never have come up with on my own. 
>>> 
>>> Roger
>>> 
 On Mar 13, 2022, at 1:05 PM, J. Landman Gay via use-livecode 
  wrote:
 
 On 3/12/22 8:54 PM, Roger Guay via use-livecode wrote:
> I have a field with about a thousand lines with many duplicate lines, and 
> I want to delete the duplicates. Seems like this should be simple but I 
> am running around in circles. Can anyone help me with this?
 
 Making the list into an array is the easiest way but as mentioned, it will 
 destroy the original order. If the order is important then you can restore 
 it with a custom sort function. Here's my test handlers:
 
 
 on mouseUp
 put fld 1 into tData -- we keep this as a reference to the original order
 put tData into tTrimmedData -- this one will change
 split tTrimmedData by cr as set -- removes duplicates
 put keys(tTrimmedData) into tTrimmedData -- convert to a text list
 sort tTrimmedData numeric by origOrder(each,tData)
 put tTrimmedData into fld 1
 end mouseUp
 
 function origOrder pWord, @pData
 set wholematches to true -- may not matter, depends on the data
 return lineoffset(pWord, pData)
 end origOrder
 
 Field 1 contains lines in random order with duplicates.
 
 -- 
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.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
>>> 
>>> 
>>> ___
>>> 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
> 
> 
> ___
> 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: Speaking of Filter and Match...

2022-03-14 Thread Bob Sneidar via use-livecode
Actually I must correct myself. That will not work because the unique value 
column (typically an autoincrementing integer) will not be unique for each 
record. Instead, assuming your lines of text are in a column called "textdata" 

SELECT textdata UNIQUE FROM...

Bob S


> On Mar 14, 2022, at 08:29 , Bob Sneidar via use-livecode 
>  wrote:
> 
> They depend on the fact that arrays cannot have duplicate keys. Dumping the 
> data into an SQL database and querying using the UNIQUE statement would do it 
> too. 
> 
> SELECT * UNIQUE from ...
> 
> Bob S
> 
> 
> 
>> On Mar 13, 2022, at 13:16 , Roger Guay via use-livecode 
>>  wrote:
>> 
>> Thank you Jacqueline, Alex and Terry. Very interesting new (for me) methods 
>> that I would never have come up with on my own. 
>> 
>> Roger
>> 
>>> On Mar 13, 2022, at 1:05 PM, J. Landman Gay via use-livecode 
>>>  wrote:
>>> 
>>> On 3/12/22 8:54 PM, Roger Guay via use-livecode wrote:
 I have a field with about a thousand lines with many duplicate lines, and 
 I want to delete the duplicates. Seems like this should be simple but I am 
 running around in circles. Can anyone help me with this?
>>> 
>>> Making the list into an array is the easiest way but as mentioned, it will 
>>> destroy the original order. If the order is important then you can restore 
>>> it with a custom sort function. Here's my test handlers:
>>> 
>>> 
>>> on mouseUp
>>> put fld 1 into tData -- we keep this as a reference to the original order
>>> put tData into tTrimmedData -- this one will change
>>> split tTrimmedData by cr as set -- removes duplicates
>>> put keys(tTrimmedData) into tTrimmedData -- convert to a text list
>>> sort tTrimmedData numeric by origOrder(each,tData)
>>> put tTrimmedData into fld 1
>>> end mouseUp
>>> 
>>> function origOrder pWord, @pData
>>> set wholematches to true -- may not matter, depends on the data
>>> return lineoffset(pWord, pData)
>>> end origOrder
>>> 
>>> Field 1 contains lines in random order with duplicates.
>>> 
>>> -- 
>>> Jacqueline Landman Gay | jac...@hyperactivesw.com
>>> HyperActive Software   | http://www.hyperactivesw.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
>> 
>> 
>> ___
>> 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


___
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: Speaking of Filter and Match...

2022-03-14 Thread Bob Sneidar via use-livecode
They depend on the fact that arrays cannot have duplicate keys. Dumping the 
data into an SQL database and querying using the UNIQUE statement would do it 
too. 

SELECT * UNIQUE from ...

Bob S



> On Mar 13, 2022, at 13:16 , Roger Guay via use-livecode 
>  wrote:
> 
> Thank you Jacqueline, Alex and Terry. Very interesting new (for me) methods 
> that I would never have come up with on my own. 
> 
> Roger
> 
>> On Mar 13, 2022, at 1:05 PM, J. Landman Gay via use-livecode 
>>  wrote:
>> 
>> On 3/12/22 8:54 PM, Roger Guay via use-livecode wrote:
>>> I have a field with about a thousand lines with many duplicate lines, and I 
>>> want to delete the duplicates. Seems like this should be simple but I am 
>>> running around in circles. Can anyone help me with this?
>> 
>> Making the list into an array is the easiest way but as mentioned, it will 
>> destroy the original order. If the order is important then you can restore 
>> it with a custom sort function. Here's my test handlers:
>> 
>> 
>> on mouseUp
>> put fld 1 into tData -- we keep this as a reference to the original order
>> put tData into tTrimmedData -- this one will change
>> split tTrimmedData by cr as set -- removes duplicates
>> put keys(tTrimmedData) into tTrimmedData -- convert to a text list
>> sort tTrimmedData numeric by origOrder(each,tData)
>> put tTrimmedData into fld 1
>> end mouseUp
>> 
>> function origOrder pWord, @pData
>> set wholematches to true -- may not matter, depends on the data
>> return lineoffset(pWord, pData)
>> end origOrder
>> 
>> Field 1 contains lines in random order with duplicates.
>> 
>> -- 
>> Jacqueline Landman Gay | jac...@hyperactivesw.com
>> HyperActive Software   | http://www.hyperactivesw.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
> 
> 
> ___
> 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: Speaking of Filter and Match...

2022-03-13 Thread Roger Guay via use-livecode
Thank you Jacqueline, Alex and Terry. Very interesting new (for me) methods 
that I would never have come up with on my own. 

Roger

> On Mar 13, 2022, at 1:05 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 3/12/22 8:54 PM, Roger Guay via use-livecode wrote:
>> I have a field with about a thousand lines with many duplicate lines, and I 
>> want to delete the duplicates. Seems like this should be simple but I am 
>> running around in circles. Can anyone help me with this?
> 
> Making the list into an array is the easiest way but as mentioned, it will 
> destroy the original order. If the order is important then you can restore it 
> with a custom sort function. Here's my test handlers:
> 
> 
> on mouseUp
>  put fld 1 into tData -- we keep this as a reference to the original order
>  put tData into tTrimmedData -- this one will change
>  split tTrimmedData by cr as set -- removes duplicates
>  put keys(tTrimmedData) into tTrimmedData -- convert to a text list
>  sort tTrimmedData numeric by origOrder(each,tData)
>  put tTrimmedData into fld 1
> end mouseUp
> 
> function origOrder pWord, @pData
>  set wholematches to true -- may not matter, depends on the data
>  return lineoffset(pWord, pData)
> end origOrder
> 
> Field 1 contains lines in random order with duplicates.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.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


___
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: Speaking of Filter and Match...

2022-03-13 Thread J. Landman Gay via use-livecode

On 3/12/22 8:54 PM, Roger Guay via use-livecode wrote:

I have a field with about a thousand lines with many duplicate lines, and I 
want to delete the duplicates. Seems like this should be simple but I am 
running around in circles. Can anyone help me with this?


Making the list into an array is the easiest way but as mentioned, it will destroy the original 
order. If the order is important then you can restore it with a custom sort function. Here's my 
test handlers:



on mouseUp
  put fld 1 into tData -- we keep this as a reference to the original order
  put tData into tTrimmedData -- this one will change
  split tTrimmedData by cr as set -- removes duplicates
  put keys(tTrimmedData) into tTrimmedData -- convert to a text list
  sort tTrimmedData numeric by origOrder(each,tData)
  put tTrimmedData into fld 1
end mouseUp

function origOrder pWord, @pData
  set wholematches to true -- may not matter, depends on the data
  return lineoffset(pWord, pData)
end origOrder

Field 1 contains lines in random order with duplicates.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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


Re: Speaking of Filter and Match...

2022-03-13 Thread Tweedly via use-livecode
split tVar by CR
combine tVar by CR

If you don’t need to keep them in order.
Alex


Sent from my iPad

> On 13 Mar 2022, at 04:14, Terry Judd via use-livecode 
>  wrote:
> 
> There are sure to be more elegant ways but you could just rebuild the list 
> skipping the duplicates as you go
> 
> # tList1 contains original list
> put cr into tList2
> repeat for each line x in tList1
>if tList2 contains cr then # ensures you check whole not partial lines
># do nothing
>   else
>put x after tList2
>end if
> end repeat
> put char 2 to -2 of tList2 into tList2 # delete the leading and trailing 
> returns
> 
> If you need to retain line specific formatting in the field though you’ll 
> need a different approach.
> 
> Terry…
> 
> Terry Judd | Senior Lecturer in Medical Education
> Department of Medical 
> Education<https://medicine.unimelb.edu.au/school-structure/medical-education>
> The University of Melbourne<https://www.unimelb.edu.au/>
> M: 61-435 961 594
> E: terry.j...@unimelb.edu.au<mailto:terry.j...@unimelb.edu.au>
> Publications<https://scholar.google.com/citations?user=XC5s6wwJ=en>
> 
> 
> From: use-livecode  on behalf of Roger 
> Guay via use-livecode 
> Date: Sunday, 13 March 2022 at 1:55 pm
> To: use-livecode@lists.runrev.com 
> Cc: Roger Guay 
> Subject: Speaking of Filter and Match...
> I have a field with about a thousand lines with many duplicate lines, and I 
> want to delete the duplicates. Seems like this should be simple but I am 
> running around in circles. Can anyone help me with this?
> 
> Thanks,
> Roger
> ___
> 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


___
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: Speaking of Filter and Match...

2022-03-12 Thread Terry Judd via use-livecode
There are sure to be more elegant ways but you could just rebuild the list 
skipping the duplicates as you go

# tList1 contains original list
put cr into tList2
repeat for each line x in tList1
if tList2 contains cr then # ensures you check whole not partial lines
# do nothing
   else
put x after tList2
end if
end repeat
put char 2 to -2 of tList2 into tList2 # delete the leading and trailing returns

If you need to retain line specific formatting in the field though you’ll need 
a different approach.

Terry…

Terry Judd | Senior Lecturer in Medical Education
Department of Medical 
Education<https://medicine.unimelb.edu.au/school-structure/medical-education>
The University of Melbourne<https://www.unimelb.edu.au/>
M: 61-435 961 594
E: terry.j...@unimelb.edu.au<mailto:terry.j...@unimelb.edu.au>
Publications<https://scholar.google.com/citations?user=XC5s6wwJ=en>


From: use-livecode  on behalf of Roger 
Guay via use-livecode 
Date: Sunday, 13 March 2022 at 1:55 pm
To: use-livecode@lists.runrev.com 
Cc: Roger Guay 
Subject: Speaking of Filter and Match...
I have a field with about a thousand lines with many duplicate lines, and I 
want to delete the duplicates. Seems like this should be simple but I am 
running around in circles. Can anyone help me with this?

Thanks,
Roger
___
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


Speaking of Filter and Match...

2022-03-12 Thread Roger Guay via use-livecode
I have a field with about a thousand lines with many duplicate lines, and I 
want to delete the duplicates. Seems like this should be simple but I am 
running around in circles. Can anyone help me with this?

Thanks,
Roger
___
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: Problems with Filter?

2022-03-12 Thread Rick Harrison via use-livecode
Ok, that straightened out my confusion.

Thanks!

> On Mar 12, 2022, at 5:40 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> Exactly. You want matchtext, not filter.
> 
> There is a way to finesse this if you really need to use filter:
> 
>   local tSubString, tTarget, tLargeTextString
>   local tResult
> 
>   put "*THIS*FIND*" into tTarget
>   put "abcdef" into 
> tLargeTextString
> 
>   filter tLargeTextString with tTarget
>   set the itemDelimiter to "THIS"
>   put item 2 of tLargeTextString into tSubString
>   set the itemDelimiter to "FIND"
>   put item 1 of tSubString into tResult

___
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: Problems with Filter?

2022-03-12 Thread Mark Wieder via use-livecode

On 3/12/22 14:21, Rick Harrison via use-livecode wrote:


So what did it filter?  It’s the same string I started with.


Exactly. You want matchtext, not filter.

There is a way to finesse this if you really need to use filter:

   local tSubString, tTarget, tLargeTextString
   local tResult

   put "*THIS*FIND*" into tTarget
   put "abcdef" into 
tLargeTextString


   filter tLargeTextString with tTarget
   set the itemDelimiter to "THIS"
   put item 2 of tLargeTextString into tSubString
   set the itemDelimiter to "FIND"
   put item 1 of tSubString into tResult

--
 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


Re: Problems with Filter?

2022-03-12 Thread Brian Milby via use-livecode
Your source was only one line.  The default for filter is to work by line.  It 
returns all lines that match, hence the same string you started with.

Sent from my iPhone

> On Mar 12, 2022, at 5:22 PM, Rick Harrison via use-livecode 
>  wrote:
> 
> 
> put "THIS*FIND" into tTarget
> 
> put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString
> 
> put tLargeTextString into pText
> 
> 
> — Adding your code here Mark:
> put ".*THIS.*FIND.*" into tTarget
> 
> filter pText with regex pattern tTarget into tFilteredTextResult
> 
> answer "tFilteredTextResult = " & tFilteredTextResult
> 
> yields: 
> 
> tFilteredTextResult = "abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz”
> 
> So what did it filter?  It’s the same string I started with.
> 
> Rick
> 
>> On Mar 12, 2022, at 3:43 PM, Mark Wieder via use-livecode 
>>  wrote:
>> 
>> or
>>   put ".*THIS.*FIND.*" into tTarget
>>   filter pText with regex pattern tTarget into tFilteredTextResult
> 
> ___
> 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: Problems with Filter?

2022-03-12 Thread Rick Harrison via use-livecode

put "THIS*FIND" into tTarget

put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString

put tLargeTextString into pText


— Adding your code here Mark:
put ".*THIS.*FIND.*" into tTarget

filter pText with regex pattern tTarget into tFilteredTextResult

answer "tFilteredTextResult = " & tFilteredTextResult

yields: 

tFilteredTextResult = "abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz”

So what did it filter?  It’s the same string I started with.

Rick

> On Mar 12, 2022, at 3:43 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> or
>put ".*THIS.*FIND.*" into tTarget
>filter pText with regex pattern tTarget into tFilteredTextResult

___
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: Problems with Filter?

2022-03-12 Thread J. Landman Gay via use-livecode

On 3/12/22 2:29 PM, Brian Milby via use-livecode wrote:

Filter removes non-matching lines.


Unless you use "filter x without y".

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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


Re: Problems with Filter?

2022-03-12 Thread Mark Wieder via use-livecode

On 3/12/22 12:06, Rick Harrison via use-livecode wrote:

Hi Mark,

matchText works fine.

That doesn’t explain why “filter” doesn’t work though.


Yes. It does. Filter won't give you a substring.

You can use filter to get the whole line of text, but you'll still have 
to dig out the substring if that's what you're after.


In your original code, change to
put "*THIS*FIND*" into tTarget
filter pText with tTarget into tFilteredTextResult
or
put ".*THIS.*FIND.*" into tTarget
filter pText with regex pattern tTarget into tFilteredTextResult

--
 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


Re: Problems with Filter?

2022-03-12 Thread Brian Milby via use-livecode
Filter removes non-matching lines.

On Sat, Mar 12, 2022 at 3:07 PM Rick Harrison via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Mark,
>
> matchText works fine.
>
> That doesn’t explain why “filter” doesn’t work though.
>
> Thanks!
>
> Rick
>
> > On Mar 12, 2022, at 2:05 PM, Mark Wieder via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Try matchtext rather than filter:
> >
> > local tTextt, tFound?
> > put matchtext(tLargeTextString, ".*THIS(.*)FIND.*", tText) into tFound?
>
> ___
> 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: Problems with Filter?

2022-03-12 Thread Rick Harrison via use-livecode
Hi Mark,

matchText works fine.

That doesn’t explain why “filter” doesn’t work though.

Thanks!

Rick

> On Mar 12, 2022, at 2:05 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> Try matchtext rather than filter:
> 
> local tTextt, tFound?
> put matchtext(tLargeTextString, ".*THIS(.*)FIND.*", tText) into tFound?

___
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: Problems with Filter?

2022-03-12 Thread Mark Wieder via use-livecode

On 3/12/22 08:43, Rick Harrison via use-livecode wrote:

Good Morning!

I’m trying to get filter to work with some text and so far no success at all.

Given large string:  abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz

I want the text between THIS and FIND which could be anything like ISLJFKKDKLS

It’s OK to include the THIS and FIND in my result.

I’m thinking I need a wildcard character like * to get the information.


So if I try:
put "THIS*FIND" into tTarget

put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString

put tLargeTextString into pText

filter pText with regex tTarget into tFilteredTextResult

answer "tFilteredTextResult = " & tFilteredTextResult

One might think this would work, but it doesn’t, and I get nothing for 
tFilteredTextResult

Suggestions?


Try matchtext rather than filter:

local tTextt, tFound?
put matchtext(tLargeTextString, ".*THIS(.*)FIND.*", tText) into tFound?

--
 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


Re: Problems with Filter?

2022-03-12 Thread Jim Lambert via use-livecode
Try:

put "*THISISMYTEXTTOFIND*" into tTarget
put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString

put tLargeTextString into pText

filter pText with tTarget into tFilteredTextResult

answer "tFilteredTextResult = " & tFilteredTextResult

Or more simply:
filter tLargeTextString with "*THISISMYTEXTTOFIND*" into tFilteredTextResult


___
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


Problems with Filter?

2022-03-12 Thread Rick Harrison via use-livecode
Good Morning!

I’m trying to get filter to work with some text and so far no success at all.

Given large string:  abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz

I want the text between THIS and FIND which could be anything like ISLJFKKDKLS

It’s OK to include the THIS and FIND in my result.

I’m thinking I need a wildcard character like * to get the information.


So if I try:
put "THIS*FIND" into tTarget

put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString

put tLargeTextString into pText

filter pText with regex tTarget into tFilteredTextResult

answer "tFilteredTextResult = " & tFilteredTextResult

One might think this would work, but it doesn’t, and I get nothing for 
tFilteredTextResult

Suggestions?


___
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: can I filter lines with a list of alternative OR strings?

2022-03-06 Thread Dick Kriesel via use-livecode

> On Mar 3, 2022, at 2:30 AM, David V Glasgow via use-livecode 
>  wrote:
> 
> I can filter text using a single term plus a numerical range s eg:
> *re 1[0-5]*
> matching a text stem “re “ followed by any one of 10, 11, 12, 13, 14 or 15 
> 
> But is there a form where the alternatives are also text?  eg something like:
> 
> *big [“dog”, “cat”, “fish”]*

Hi, David.

regex supports alternation, so if you put "big dog|big fish" into tTarget then 
you can

filter pText with regex tTarget


Does that work for you?

— Dick
___
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


can I filter lines with a list of alternative OR strings?

2022-03-03 Thread David V Glasgow via use-livecode


Hi Folks,

I can filter text using a single term plus a numerical range s eg:
*re 1[0-5]*
matching a text stem “re “ followed by any one of 10, 11, 12, 13, 14 or 15 

But is there a form where the alternatives are also text?  eg something like:

*big [“dog”, “cat”, “fish”]*

The above searches OK, but only for “big”.  There is no error, but the 
parenthetic list is ignored, I think.  A number of lines 'filtered with' 
contain the stem but none of the listed suffix strings.

I suppose there is also a supplementary question that if there is a list of 
alternative strings  option, is it more efficient than filtering for "big dog", 
big cat, etc in turn?  If the option exists I feel like it ought to be faster, 
but what do I know?

Cheers

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


Re: filter

2020-11-20 Thread Bob Sneidar via use-livecode
Yeah, not confusing at all. ;-P

Bob S


On Nov 20, 2020, at 9:55 AM, Mark Wieder via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

On 11/20/20 3:27 AM, David V Glasgow via use-livecode wrote:
Apologies for barging in, but I am confused by regex generally and in this 
specific example by the function of the terminal ‘+’  If you are only finding 
one character, why do you need to specify 'at least one' of one char?

Ha!
Yeah, I actually mistyped that (moi?).

"^\[" is all that's necessary for the filter command.

...but Klaus' form of "[[]*[]]" is actually better if the field has
[500] and then text

--
Mark Wieder
ahsoftw...@gmail.com<mailto: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


Re: filter

2020-11-20 Thread Mark Wieder via use-livecode

On 11/20/20 3:27 AM, David V Glasgow via use-livecode wrote:

Apologies for barging in, but I am confused by regex generally and in this 
specific example by the function of the terminal ‘+’  If you are only finding 
one character, why do you need to specify 'at least one' of one char?


Ha!
Yeah, I actually mistyped that (moi?).

"^\[" is all that's necessary for the filter command.

...but Klaus' form of "[[]*[]]" is actually better if the field has
[500] and then text

--
 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


Re: filter

2020-11-20 Thread David V Glasgow via use-livecode
Apologies for barging in, but I am confused by regex generally and in this 
specific example by the function of the terminal ‘+’  If you are only finding 
one character, why do you need to specify 'at least one' of one char?

Cheers

David G

> On 20 Nov 2020, at 8:44 am, Klaus major-k via use-livecode 
>  wrote:
> 
>> ^ = start at beginning of line
>> \[ = a literal "[" character ("\" escapes whatever comes next)
>> + = at least one of those characters

___
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: filter

2020-11-20 Thread Klaus major-k via use-livecode
Hi Mark,

> Am 20.11.2020 um 00:55 schrieb Mark Wieder via use-livecode 
> :
> On 11/19/20 9:09 AM, Klaus major-k via use-livecode wrote:
>> Hi Mark,
>>> Am 19.11.2020 um 18:07 schrieb Mark Wieder via use-livecode 
>>> :
>>> On 11/19/20 7:38 AM, Mark Waddingham via use-livecode wrote:
>>>> I think:
>>>>   filter fld 1 with "[[]*"
>>>> Should do the trick...
>>> As an alternative,
>>> filter fld 1 with regex pattern "^\[+"
>>> also does the trick.
>> thanks, but REGEX is still a TAD over my head. ;-)
> Not really...

how do you know? 8-)

> this is at least as simple as what you just coded:
> 
> ^ = start at beginning of line
> \[ = a literal "[" character ("\" escapes whatever comes next)
> + = at least one of those characters

Thank you, now I am ready to challenge Thierry! :-D

> -- 
> Mark Wieder
> ahsoftw...@gmail.com

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
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: filter

2020-11-19 Thread Mark Wieder via use-livecode

On 11/19/20 9:09 AM, Klaus major-k via use-livecode wrote:

Hi Mark,


Am 19.11.2020 um 18:07 schrieb Mark Wieder via use-livecode 
:
On 11/19/20 7:38 AM, Mark Waddingham via use-livecode wrote:

I think:
   filter fld 1 with "[[]*"
Should do the trick...

As an alternative,
filter fld 1 with regex pattern "^\[+"
also does the trick.


thanks, but REGEX is still a TAD over my head. ;-)


Not really... this is at least as simple as what you just coded:

^ = start at beginning of line
\[ = a literal "[" character ("\" escapes whatever comes next)
+ = at least one of those characters

--
 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


RE: filter

2020-11-19 Thread Craig newman via use-livecode
Klaus.

I use "filter" here and there, mostly with regex or wildCards. 

But nothing works for me either,:

Filter yourText with "["
Filter yourText where each contains "["

Not sure what is going on. Where is Thieery?

Craig
-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Klaus major-k via use-livecode
Sent: Thursday, November 19, 2020 10:19 AM
To: How to use LiveCode 
Cc: Klaus major-k 
Subject: filter

Hi all,

I am surely missing something here with filter.

I have a field with some lines like:
...
[500]
text yadda
yadda
[100]
...
And want to filter the field that only the lines with [...] remain in the
field.

So I thought
...
filter fld 1 with "[*" 
...
would do the job, but that EMPTIES the field!?
Obviously this [ interferes with some REGEX mechanism of filter?
So what should I use now?

Any hints very appreciated!


Best

Klaus
--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
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: filter

2020-11-19 Thread Bob Sneidar via use-livecode
I don’t think I could watch! Oh the horror!

Bob S


> On Nov 19, 2020, at 9:17 AM, Keith Clarke via use-livecode 
>  wrote:
> 
> The chronicles of regex - a potential blockbuster there, Bob! :-)
> Best,
> Keith
> 
>> On 19 Nov 2020, at 16:49, Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> No one escapes the lair of the Regex Demon. Except for maybe Riddick.
>> 
>> Bob S
>> 
>> 
>> On Nov 19, 2020, at 8:15 AM, Keith Clarke via use-livecode 
>> mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> Ha, yes I understand that desire - and Mark’s one-character escape trick 
>> beats my hack to bypass the lair of the regex demon! :D
>> Best,
>> Keith
___
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: filter

2020-11-19 Thread Keith Clarke via use-livecode
The chronicles of regex - a potential blockbuster there, Bob! :-)
Best,
Keith

> On 19 Nov 2020, at 16:49, Bob Sneidar via use-livecode 
>  wrote:
> 
> No one escapes the lair of the Regex Demon. Except for maybe Riddick.
> 
> Bob S
> 
> 
> On Nov 19, 2020, at 8:15 AM, Keith Clarke via use-livecode 
> mailto:use-livecode@lists.runrev.com>> wrote:
> 
> Ha, yes I understand that desire - and Mark’s one-character escape trick 
> beats my hack to bypass the lair of the regex demon! :D
> Best,
> Keith
> 
> ___
> 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: filter

2020-11-19 Thread Klaus major-k via use-livecode
Hi Mark,

> Am 19.11.2020 um 18:07 schrieb Mark Wieder via use-livecode 
> :
> On 11/19/20 7:38 AM, Mark Waddingham via use-livecode wrote:
>> I think:
>>   filter fld 1 with "[[]*"
>> Should do the trick...
> As an alternative,
> filter fld 1 with regex pattern "^\[+"
> also does the trick.

thanks, but REGEX is still a TAD over my head. ;-)

> -- 
> Mark Wieder
> ahsoftw...@gmail.com

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
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: filter

2020-11-19 Thread Mark Wieder via use-livecode

On 11/19/20 7:38 AM, Mark Waddingham via use-livecode wrote:


I think:

   filter fld 1 with "[[]*"

Should do the trick...


As an alternative,

filter fld 1 with regex pattern "^\[+"

also does the trick.

--
 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


Re: filter

2020-11-19 Thread Bob Sneidar via use-livecode
No one escapes the lair of the Regex Demon. Except for maybe Riddick.

Bob S


On Nov 19, 2020, at 8:15 AM, Keith Clarke via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

Ha, yes I understand that desire - and Mark’s one-character escape trick beats 
my hack to bypass the lair of the regex demon! :D
Best,
Keith

___
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: filter

2020-11-19 Thread Keith Clarke via use-livecode
Ha, yes I understand that desire - and Mark’s one-character escape trick beats 
my hack to bypass the lair of the regex demon! :D
Best,
Keith

> On 19 Nov 2020, at 15:51, Klaus major-k via use-livecode 
>  wrote:
> 
> Hi Keith,
> 
>> Am 19.11.2020 um 16:38 schrieb Keith Clarke via use-livecode 
>> :
>> 
>> Hi Klaus,
>> Maybe iterate the lines - untested...
>> repeat for each line l in fld 1
>> if and( offset( “[“, l) > 0 , offset(“]”, l) > 0 ) then put line l of fld 1 
>> into tList
>> end repeat 
>> put tList
> 
> yes, sure, but "lazy moi" wanted to use FILTER and also understand why my 
> first script did not work. :-)
> 
>> Best,
>> Keith 
> 
> Best
> 
> Klaus
> 
> --
> Klaus Major
> https://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> 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: filter

2020-11-19 Thread Klaus major-k via use-livecode
Hi Keith,

> Am 19.11.2020 um 16:38 schrieb Keith Clarke via use-livecode 
> :
> 
> Hi Klaus,
> Maybe iterate the lines - untested...
> repeat for each line l in fld 1
>  if and( offset( “[“, l) > 0 , offset(“]”, l) > 0 ) then put line l of fld 1 
> into tList
> end repeat 
> put tList

yes, sure, but "lazy moi" wanted to use FILTER and also understand why my first 
script did not work. :-)

> Best,
> Keith 

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
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: filter

2020-11-19 Thread Klaus major-k via use-livecode
Hi Mark,

> Am 19.11.2020 um 16:38 schrieb Mark Waddingham via use-livecode 
> :
> 
>> So I thought
>> ...
>> filter fld 1 with "[*"
>> ...
>> would do the job, but that EMPTIES the field!?
>> Obviously this [ interferes with some REGEX mechanism of filter?
>> So what should I use now?
> I think:
>  filter fld 1 with "[[]*"
> Should do the trick...
> Basically, you can use '[...]' to 'escape' the operators in the wildcard 
> pattern (i.e. *, [ and ?).

ah, get it! So I added this accordingly:
...
filter fld 1 with "[[]*[]]"
...
to be on the safe side and it works like a charme!

> Hope this helps,

Yes, it does, thank you very much!

> Mark.
> 
> P.S. Wildcard patterns are a lot simpler than general regexes, but 'filter' 
> can do both "filter ... with regex pattern ..." interprets the pattern the 
> same as matchText/replaceText.
> 
> -- 
> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
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: filter

2020-11-19 Thread Keith Clarke via use-livecode
Hi Klaus,
Maybe iterate the lines - untested...

repeat for each line l in fld 1
  if and( offset( “[“, l) > 0 , offset(“]”, l) > 0 ) then put line l of fld 1 
into tList
end repeat 

put tList

Best,
Keith 

> On 19 Nov 2020, at 15:19, Klaus major-k via use-livecode 
>  wrote:
> 
> Hi all,
> 
> I am surely missing something here with filter.
> 
> I have a field with some lines like:
> ...
> [500]
> text yadda
> yadda
> [100]
> ...
> And want to filter the field that only the lines with [...] remain in the 
> field.
> 
> So I thought
> ...
> filter fld 1 with "[*" 
> ...
> would do the job, but that EMPTIES the field!?
> Obviously this [ interferes with some REGEX mechanism of filter?
> So what should I use now?
> 
> Any hints very appreciated!
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> https://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> 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: filter

2020-11-19 Thread Mark Waddingham via use-livecode

So I thought
...
filter fld 1 with "[*"
...
would do the job, but that EMPTIES the field!?
Obviously this [ interferes with some REGEX mechanism of filter?
So what should I use now?


I think:

  filter fld 1 with "[[]*"

Should do the trick...

Basically, you can use '[...]' to 'escape' the operators in the wildcard 
pattern (i.e. *, [ and ?).


Hope this helps,

Mark.

P.S. Wildcard patterns are a lot simpler than general regexes, but 
'filter' can do both "filter ... with regex pattern ..." interprets the 
pattern the same as matchText/replaceText.


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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


filter

2020-11-19 Thread Klaus major-k via use-livecode
Hi all,

I am surely missing something here with filter.

I have a field with some lines like:
...
[500]
text yadda
yadda
[100]
...
And want to filter the field that only the lines with [...] remain in the field.

So I thought
...
filter fld 1 with "[*" 
...
would do the job, but that EMPTIES the field!?
Obviously this [ interferes with some REGEX mechanism of filter?
So what should I use now?

Any hints very appreciated!


Best

Klaus
--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
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: 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.com
HyperActive Software | http://www.hyperactivesw.com
On June 21, 2019 5:32:26 PM Bob Sneidar via use-livecode 
 wrote:


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 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 discovered it happens only with Step Over. It's 
hard to believe no one else has seen this, which I've been seeing since LC 
9 first came out, but that's why I didn't know what was in the variable.
I've been seeing this too. But it's time to confess my abysmal ignorance - 
how do I get a crash log ?


On Mac, a huge dialog appears with the crash log in it. I select all, copy, 
paste into a text document and save it. On Windows I don't know, but if 
there's a system log (like Console displays on Mac) it's probably in there.



(And is it worthwhile me getting some of them to add to the bug reports?)


Good question. I've uploaded maybe 20-25 of them so far. I don't always 
bother any more.


Now that I've discovered breakpoints don't crash as long as I don't step 
through, I was able to see what's going on.


I was wrong. Not more than a few minutes ago I crashed after stopping at 
multiple breakpoints. It doesn't seem to matter if they're red-dot or 
typed. However, it seems to take more repetitions before the crash if you 
don't do any stepping.


Hmmm - I find I have no choice but to step through; the editor/debugger so 
often "freezes" (i.e. when I scroll the text, the line numbers don't scroll 
at the same time).


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 everything goes down.


This has really been crippling my productivity. I'm sure it's a very 
elusive thing to track down but I hope they can find it. If no one else has 
a problem, it may be something script-related that both you and I are doing.



So I can't just set another breakpoint further down - I have to step over 
for a while until the place at which I want to set the breakpoint scrolls 
itself into view.


If you have experienced crashes during debugging, take a look at 
https://quality.livecode.com/show_bug.cgi?id=22130 and 
https://quality.livecode.com/show_bug.cgi?id=21876



Alex.
___
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



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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



___
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: 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 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 discovered it happens only with Step Over. It's 
>>> hard to believe no one else has seen this, which I've been seeing since LC 
>>> 9 first came out, but that's why I didn't know what was in the variable.
>> I've been seeing this too. But it's time to confess my abysmal ignorance - 
>> how do I get a crash log ?
> 
> On Mac, a huge dialog appears with the crash log in it. I select all, copy, 
> paste into a text document and save it. On Windows I don't know, but if 
> there's a system log (like Console displays on Mac) it's probably in there.
> 
>> (And is it worthwhile me getting some of them to add to the bug reports?)
> 
> Good question. I've uploaded maybe 20-25 of them so far. I don't always 
> bother any more.
> 
>>> Now that I've discovered breakpoints don't crash as long as I don't step 
>>> through, I was able to see what's going on.
> 
> I was wrong. Not more than a few minutes ago I crashed after stopping at 
> multiple breakpoints. It doesn't seem to matter if they're red-dot or typed. 
> However, it seems to take more repetitions before the crash if you don't do 
> any stepping.
> 
>> Hmmm - I find I have no choice but to step through; the editor/debugger so 
>> often "freezes" (i.e. when I scroll the text, the line numbers don't scroll 
>> at the same time).
> 
> 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 everything goes down.
> 
> This has really been crippling my productivity. I'm sure it's a very elusive 
> thing to track down but I hope they can find it. If no one else has a 
> problem, it may be something script-related that both you and I are doing.
> 
> 
>> So I can't just set another breakpoint further down - I have to step over 
>> for a while until the place at which I want to set the breakpoint scrolls 
>> itself into view.
>>> 
>>> If you have experienced crashes during debugging, take a look at 
>>> https://quality.livecode.com/show_bug.cgi?id=22130 and 
>>> https://quality.livecode.com/show_bug.cgi?id=21876
>>> 
>> Alex.
>> ___
>> 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
> 
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.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


___
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: 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 everything goes down.
> 
> This has really been crippling my productivity. I'm sure it's a very elusive 
> thing to track down but I hope they can find it. If no one else has a 
> problem, it may be something script-related that both you and I are doing.


I have this problem too. I think it has been around for a very long time. I 
have a bug report for it as well.
https://quality.livecode.com/show_bug.cgi?id=22101 



Best regards,

Mark Talluto
livecloud.io 
nursenotes.net 
canelasoftware.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


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 discovered it happens only 
with Step Over. It's hard to believe no one else has seen this, which 
I've been seeing since LC 9 first came out, but that's why I didn't 
know what was in the variable.


I've been seeing this too. But it's time to confess my abysmal ignorance 
- how do I get a crash log ?


On Mac, a huge dialog appears with the crash log in it. I select all, 
copy, paste into a text document and save it. On Windows I don't know, 
but if there's a system log (like Console displays on Mac) it's probably 
in there.




(And is it worthwhile me getting some of them to add to the bug reports?)


Good question. I've uploaded maybe 20-25 of them so far. I don't always 
bother any more.




Now that I've discovered breakpoints don't crash as long as I don't 
step through, I was able to see what's going on.


I was wrong. Not more than a few minutes ago I crashed after stopping at 
multiple breakpoints. It doesn't seem to matter if they're red-dot or 
typed. However, it seems to take more repetitions before the crash if 
you don't do any stepping.


Hmmm - I find I have no choice but to step through; the editor/debugger 
so often "freezes" (i.e. when I scroll the text, the line numbers don't 
scroll at the same time).


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 
everything goes down.


This has really been crippling my productivity. I'm sure it's a very 
elusive thing to track down but I hope they can find it. If no one else 
has a problem, it may be something script-related that both you and I 
are doing.



So I can't just set another breakpoint further 
down - I have to step over for a while until the place at which I want 
to set the breakpoint scrolls itself into view.


If you have experienced crashes during debugging, take a look at 
https://quality.livecode.com/show_bug.cgi?id=22130 and 
https://quality.livecode.com/show_bug.cgi?id=21876



Alex.

___
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




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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


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 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.


___
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: 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-livecode@lists.runrev.com> wrote:

> 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).
>
> Thanks
>
> Alex.
>
> On 21/06/2019 16:02, Bob Sneidar via use-livecode wrote:
> > 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
> array. Also, if you need to make multiple passes at the data, the speed of
> course exceeds iterating through the array again and again. Finally, since
> it's in a database, it's persistent through idle, whereas an array would
> have to be stored in a script local or a property if you needed it across
> runtime sessions.
> >
> > Bob S
> >
> >
> >> On Jun 20, 2019, at 21:10 , Tom Glod via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>
> >> 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 for my particular use at the moment, I find LC
> >> performance to be excellent.
> >>
> >> Bob I'm interested in your library..mostly learning the point at
> which
> >> it makes sense to do that conversion and what kind of speedups can
> >> occur.have you done any benchmarks on it?
> >>
> >> Great reminder & idea Monte
> >
> > ___
> > 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
___
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: 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 believe no one else has seen this, which 
I've been seeing since LC 9 first came out, but that's why I didn't 
know what was in the variable.


I've been seeing this too. But it's time to confess my abysmal ignorance 
- how do I get a crash log ?


(And is it worthwhile me getting some of them to add to the bug reports?)

Now that I've discovered breakpoints don't crash as long as I don't 
step through, I was able to see what's going on.
Hmmm - I find I have no choice but to step through; the editor/debugger 
so often "freezes" (i.e. when I scroll the text, the line numbers don't 
scroll at the same time). So I can't just set another breakpoint further 
down - I have to step over for a while until the place at which I want 
to set the breakpoint scrolls itself into view.


If you have experienced crashes during debugging, take a look at 
https://quality.livecode.com/show_bug.cgi?id=22130 and 
https://quality.livecode.com/show_bug.cgi?id=21876



Alex.

___
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: 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's only recently I've discovered it happens only with Step 
Over. It's hard to believe no one else has seen this, which I've been 
seeing since LC 9 first came out, but that's why I didn't know what was 
in the variable. Now that I've discovered breakpoints don't crash as 
long as I don't step through, I was able to see what's going on.


If you have experienced crashes during debugging, take a look at 
https://quality.livecode.com/show_bug.cgi?id=22130 and 
https://quality.livecode.com/show_bug.cgi?id=21876


I have several more in my collection that I haven't uploaded yet.

On 6/21/19 4:26 AM, Niggemann, Bernd via use-livecode wrote:


Am 21.06.2019 um 09:01 schrieb 
use-livecode-requ...@lists.runrev.com<mailto: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 all start with a 4-character string followed by an
underscore, for example:  ER01_some text here

My variable contains "ER01":

   put tVar & "_*" into tFilter
   filter elements of sArray with tFilter into tNewArray

No go. I've tried a few different iterations. However, this works:

   filter elements of sArray with "ER01_*" into tNewArray


This works for me in 9.0.4 and 9.5 DP1


on mouseUp
local tErr = "ER01"
local tArray, tVar, tNewArray

put (tErr & "_*") into tVar

repeat with i = 1 to 17
   if i mod 2 is 1 then
  put tErr & "_" & i into tArray[i]
   else
  put i into tArray[i]
   end if
end repeat
    breakpoint
filter elements of tArray with tVar into tNewArray
breakpoint
filter elements of tArray with tVar
breakpoint
end mouseUp


may be O <> zero?

Kind regards
Bernd


___
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




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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


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).


Thanks

Alex.

On 21/06/2019 16:02, Bob Sneidar via use-livecode wrote:

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 array. Also, if you need to 
make multiple passes at the data, the speed of course exceeds iterating through 
the array again and again. Finally, since it's in a database, it's persistent 
through idle, whereas an array would have to be stored in a script local or a 
property if you needed it across runtime sessions.

Bob S



On Jun 20, 2019, at 21:10 , Tom Glod via use-livecode 
 wrote:

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 for my particular use at the moment, I find LC
performance to be excellent.

Bob I'm interested in your library..mostly learning the point at which
it makes sense to do that conversion and what kind of speedups can
occur.have you done any benchmarks on it?

Great reminder & idea Monte


___
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: 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 array. Also, if you need to 
make multiple passes at the data, the speed of course exceeds iterating through 
the array again and again. Finally, since it's in a database, it's persistent 
through idle, whereas an array would have to be stored in a script local or a 
property if you needed it across runtime sessions. 

Bob S


> On Jun 20, 2019, at 21:10 , Tom Glod via use-livecode 
>  wrote:
> 
> 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 for my particular use at the moment, I find LC
> performance to be excellent.
> 
> Bob I'm interested in your library..mostly learning the point at which
> it makes sense to do that conversion and what kind of speedups can
> occur.have you done any benchmarks on it?
> 
> Great reminder & idea Monte


___
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: 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.)

> On Jun 21, 2019, at 1:01 AM, J. Landman Gay via use-livecode 
>  wrote:
> 
> 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 & "_*" into tFilter
>  filter elements of sArray with tFilter into tNewArray
> 
> No go. I've tried a few different iterations. However, this works:
> 
>  filter elements of sArray with "ER01_*" into tNewArray
> 
> Even with no matches though, Tom was right. Looping through the keys takes 
> 0.03 milliseconds. Filtering takes 0.22 ms.
> 
> On 6/21/19 1:38 AM, J. Landman Gay via use-livecode wrote:
>> 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. So that part's solved.
>> And I found something interesting: when I filter a numeric array, the keys 
>> remain attached and since they are numeric, they're in order. Fancy that. :)
>> All is well. Thanks guys.
>> On 6/20/19 11:10 PM, Tom Glod via use-livecode wrote:
>>> A great question Jacque Helpful thread all around.
> 
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.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
> 


___
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: 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<mailto: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 all start with a 4-character string followed by an
underscore, for example:  ER01_some text here

My variable contains "ER01":

  put tVar & "_*" into tFilter
  filter elements of sArray with tFilter into tNewArray

No go. I've tried a few different iterations. However, this works:

  filter elements of sArray with "ER01_*" into tNewArray


This works for me in 9.0.4 and 9.5 DP1


on mouseUp
   local tErr = "ER01"
   local tArray, tVar, tNewArray

   put (tErr & "_*") into tVar

   repeat with i = 1 to 17
  if i mod 2 is 1 then
 put tErr & "_" & i into tArray[i]
  else
 put i into tArray[i]
  end if
   end repeat
   breakpoint
   filter elements of tArray with tVar into tNewArray
   breakpoint
   filter elements of tArray with tVar
   breakpoint
end mouseUp


may be O <> zero?

Kind regards
Bernd


___
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: 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 & "_*" into tFilter
  filter elements of sArray with tFilter into tNewArray

No go. I've tried a few different iterations. However, this works:

  filter elements of sArray with "ER01_*" into tNewArray

Even with no matches though, Tom was right. Looping through the keys 
takes 0.03 milliseconds. Filtering takes 0.22 ms.


On 6/21/19 1:38 AM, J. Landman Gay via use-livecode wrote:
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. So that part's solved.


And I found something interesting: when I filter a numeric array, the 
keys remain attached and since they are numeric, they're in order. Fancy 
that. :)


All is well. Thanks guys.

On 6/20/19 11:10 PM, Tom Glod via use-livecode wrote:

A great question Jacque Helpful thread all around.






--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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


Re: Filter an array by content

2019-06-21 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. So that part's solved.


And I found something interesting: when I filter a numeric array, the 
keys remain attached and since they are numeric, they're in order. Fancy 
that. :)


All is well. Thanks guys.

On 6/20/19 11:10 PM, Tom Glod via use-livecode wrote:

A great question Jacque Helpful thread all around.



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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


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 for my particular use at the moment, I find LC
performance to be excellent.

Bob I'm interested in your library..mostly learning the point at which
it makes sense to do that conversion and what kind of speedups can
occur.have you done any benchmarks on it?

Great reminder & idea Monte

On Thu, Jun 20, 2019 at 6:19 PM Monte Goulding via use-livecode <
use-livecode@lists.runrev.com> wrote:

> 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
> keys 1..N.
>
> > On 21 Jun 2019, at 6:56 am, J. Landman Gay via use-livecode <
> use-livecode@lists.runrev.com> 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?
> >
> > --
> > Jacqueline Landman Gay | jac...@hyperactivesw.com
> > HyperActive Software   | http://www.hyperactivesw.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
>
>
> ___
> 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: 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 keys 1..N.

> On 21 Jun 2019, at 6:56 am, 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 looking at each element?
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.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


___
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: 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 work:
filter elements of testDistance where each > 20.5 into failedDistance



> 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 looking at each element?
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.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


___
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: 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 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?
> 
> ___
> 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: 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 
>> keys themselves. Is there a way to do that without looping through the 
>> entire array and looking at each element?


___
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: 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?

___
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: 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 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 looking at each element?
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.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


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 looking at each element?
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.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


___
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


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://www.hyperactivesw.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


LC Wildcard filter citation source?

2018-12-08 Thread David V Glasgow via use-livecode
Hello folks,

I am writing an academic paper on an analysis of internet predator messages 
undertaken using an LC app.  

A few of the filtered terms I used incorporated wildcards (I avoided regular 
expressions).  I need to reference a published source for the implementation of 
wildcards within LC, if such a thing exists.

Does it?

Cheers,

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


RE: filter list_of_files with REGEX xyz?

2018-08-17 Thread Ralph DiMola via use-livecode
Let them eat cake.

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 Bob Sneidar via use-livecode
Sent: Friday, August 17, 2018 4:39 PM
To: How to use LiveCode
Cc: Bob Sneidar
Subject: Re: filter list_of_files with REGEX xyz?

Half want cake, the other half, pie. 

Bob S


> On Aug 17, 2018, at 09:45 , Mark Wieder via use-livecode
 wrote:
> 
> On 08/17/2018 08:54 AM, Ralph DiMola via use-livecode wrote:
>> True true... I thought about it but left it as is just in case there 
>> was an image without a file name before the ".". I did not want it to be
missed.
>> You know users...
> 
> LOL
> 
> --
> 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


___
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: filter list_of_files with REGEX xyz?

2018-08-17 Thread Bob Sneidar via use-livecode
Half want cake, the other half, pie. 

Bob S


> On Aug 17, 2018, at 09:45 , Mark Wieder via use-livecode 
>  wrote:
> 
> On 08/17/2018 08:54 AM, Ralph DiMola via use-livecode wrote:
>> True true... I thought about it but left it as is just in case there was an
>> image without a file name before the ".". I did not want it to be missed.
>> You know users...
> 
> LOL
> 
> -- 
> 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


Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Mark Wieder via use-livecode

On 08/17/2018 08:54 AM, Ralph DiMola via use-livecode wrote:

True true... I thought about it but left it as is just in case there was an
image without a file name before the ".". I did not want it to be missed.
You know users...


LOL

--
 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


RE: filter list_of_files with REGEX xyz?

2018-08-17 Thread Ralph DiMola via use-livecode
True true... I thought about it but left it as is just in case there was an
image without a file name before the ".". I did not want it to be missed.
You know users...

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: Friday, August 17, 2018 11:41 AM
To: Ralph DiMola via use-livecode
Cc: Mark Wieder
Subject: Re: filter list_of_files with REGEX xyz?

On 08/17/2018 07:13 AM, Ralph DiMola via use-livecode wrote:
> filter tList with regex pattern "(?i).*\.(jpe?g|png|gif)$"

For a file list that should probably be

filter tList with regex pattern "(?i).+\.(jpe?g|png|gif)$"

unless you explicitly want to see file names that start with "."

-- 
  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


___
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: filter list_of_files with REGEX xyz?

2018-08-17 Thread Mark Wieder via use-livecode

On 08/17/2018 07:13 AM, Ralph DiMola via use-livecode wrote:

filter tList with regex pattern "(?i).*\.(jpe?g|png|gif)$"


For a file list that should probably be

filter tList with regex pattern "(?i).+\.(jpe?g|png|gif)$"

unless you explicitly want to see file names that start with "."

--
 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


  1   2   3   4   >