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

___
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


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:

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:

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


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


Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Lagi Pittas via use-livecode
I was going to send the whole line but Hermann has beaten me to it - and I
will use his version from now on, thanks Hermann.

Lagi


On Fri, 17 Aug 2018 at 15:03, Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Hermann,
>
> > Am 17.08.2018 um 15:58 schrieb hh via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > This is already case-insensitive, but the period needs an escape:
> >
> > filter tList with regex pattern "\.*(jpe?g|png|gif)$"
>
> ah, jetzt ja! :-)
> Thanks a lot!
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://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 list_of_files with REGEX xyz?

2018-08-17 Thread Lagi Pittas via use-livecode
I used (without the gif)

.*\.jpj|jpeg|png|gif

The above is not case sensitive  - just tested it

Lagi

On Fri, 17 Aug 2018 at 14:45, Ralph DiMola via use-livecode <
use-livecode@lists.runrev.com> wrote:

> (?i) turn off case sensitivity for everything after it in the regex
> expression. (?-i) turns it back on again for everything after it.
>
> 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 Brian Milby via use-livecode
> Sent: Friday, August 17, 2018 9:19 AM
> To: How to use LiveCode
> Cc: Brian Milby
> Subject: Re: filter list_of_files with REGEX xyz?
>
> RegEx pattern
> Sorry, I was just giving the pattern, not the syntax.
> Also, it will probably be case sensitive in that format. I won’t be able
> to test until later. I don’t recall the case insensitive flag off hand.
>
> Thanks,
> Brian
> On Aug 17, 2018, 8:15 AM -0500, Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
> > Hi Brian,
> >
> > > Am 17.08.2018 um 14:40 schrieb Brian Milby via use-livecode <
> use-livecode@lists.runrev.com>:
> > >
> > > Pattern “*.(jpe?g|png|gif)”
> >
> > thanks, but that does not work!?
> >
> > I tried:
> > on mouseUp pMouseButton
> > answer folder "sdsdsdsd"
> > put it into tFolder
> > put files(tFolder) into tList
> > filter tList with pattern "*.(jpe?g|png|gif)"
> > answer tList
> > end mouseUp
> >
> > tList = EMPTY, I made of course sure there are JPG, PNG and GIF files in
> that folder.
> >
> > Same when I use:
> > ...
> > filter lines of tList with pattern "*.(jpe?g|png|gif)"
> > ...
> > Any clues?
> >
> > > Thanks,
> >
> > You're welcome! :-)
> >
> > > Brian
> > > On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
> > > > Hi friends,
> > > >
> > > > I know how to:
> > > > ...
> > > > filter list_of_files with "*.jpg"
> > > > ...
> > > > But REGEX stuff is way over my head. :-/ Can anyone provide the
> > > > regex/pattern syntax for filtering jpg, png etc. in ONE run? Know
> > > > what I mean?
> >
> > Best
> >
> > Klaus
> >
> > --
> > Klaus Major
> > http://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
>
>
> ___
> 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 Ralph DiMola via use-livecode
The ".*" is the wild card(zero or more) and "\." Is the period.

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

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 hh via use-livecode
Sent: Friday, August 17, 2018 9:58 AM
To: use-livecode@lists.runrev.com
Cc: hh
Subject: Re: filter list_of_files with REGEX xyz?

This is already case-insensitive, but the period needs an escape:

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


___
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 Brian Milby via use-livecode
Let’s try this again...
Regex pattern “.*\.(jpe?g|png)$”

. - any character
* - any number of previous match term
? - 0 or 1 of previous term
\. - escapes the period for literal match
() - groups terms
| - alternates within group
$ - end of line

Thanks,
Brian
On Aug 17, 2018, 8:45 AM -0500, Ralph DiMola via use-livecode 
, wrote:
> (?i) turn off case sensitivity for everything after it in the regex 
> expression. (?-i) turns it back on again for everything after it.
>
> 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 Brian Milby via use-livecode
> Sent: Friday, August 17, 2018 9:19 AM
> To: How to use LiveCode
> Cc: Brian Milby
> Subject: Re: filter list_of_files with REGEX xyz?
>
> RegEx pattern
> Sorry, I was just giving the pattern, not the syntax.
> Also, it will probably be case sensitive in that format. I won’t be able to 
> test until later. I don’t recall the case insensitive flag off hand.
>
> Thanks,
> Brian
> On Aug 17, 2018, 8:15 AM -0500, Klaus major-k via use-livecode 
> , wrote:
> > Hi Brian,
> >
> > > Am 17.08.2018 um 14:40 schrieb Brian Milby via use-livecode 
> > > :
> > >
> > > Pattern “*.(jpe?g|png|gif)”
> >
> > thanks, but that does not work!?
> >
> > I tried:
> > on mouseUp pMouseButton
> > answer folder "sdsdsdsd"
> > put it into tFolder
> > put files(tFolder) into tList
> > filter tList with pattern "*.(jpe?g|png|gif)"
> > answer tList
> > end mouseUp
> >
> > tList = EMPTY, I made of course sure there are JPG, PNG and GIF files in 
> > that folder.
> >
> > Same when I use:
> > ...
> > filter lines of tList with pattern "*.(jpe?g|png|gif)"
> > ...
> > Any clues?
> >
> > > Thanks,
> >
> > You're welcome! :-)
> >
> > > Brian
> > > On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode 
> > > , wrote:
> > > > Hi friends,
> > > >
> > > > I know how to:
> > > > ...
> > > > filter list_of_files with "*.jpg"
> > > > ...
> > > > But REGEX stuff is way over my head. :-/ Can anyone provide the
> > > > regex/pattern syntax for filtering jpg, png etc. in ONE run? Know
> > > > what I mean?
> >
> > Best
> >
> > Klaus
> >
> > --
> > Klaus Major
> > http://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
>
>
> ___
> 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 Klaus major-k via use-livecode
Hi Hermann,

> Am 17.08.2018 um 15:58 schrieb hh via use-livecode 
> :
> 
> This is already case-insensitive, but the period needs an escape:
> 
> filter tList with regex pattern "\.*(jpe?g|png|gif)$"

ah, jetzt ja! :-)
Thanks a lot!

Best

Klaus

--
Klaus Major
http://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 list_of_files with REGEX xyz?

2018-08-17 Thread hh via use-livecode
This is already case-insensitive, but the period needs an escape:

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


___
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
(?i) turn off case sensitivity for everything after it in the regex expression. 
(?-i) turns it back on again for everything after it.

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 
Brian Milby via use-livecode
Sent: Friday, August 17, 2018 9:19 AM
To: How to use LiveCode
Cc: Brian Milby
Subject: Re: filter list_of_files with REGEX xyz?

RegEx pattern
Sorry, I was just giving the pattern, not the syntax.
Also, it will probably be case sensitive in that format. I won’t be able to 
test until later. I don’t recall the case insensitive flag off hand.

Thanks,
Brian
On Aug 17, 2018, 8:15 AM -0500, Klaus major-k via use-livecode 
, wrote:
> Hi Brian,
>
> > Am 17.08.2018 um 14:40 schrieb Brian Milby via use-livecode 
> > :
> >
> > Pattern “*.(jpe?g|png|gif)”
>
> thanks, but that does not work!?
>
> I tried:
> on mouseUp pMouseButton
> answer folder "sdsdsdsd"
> put it into tFolder
> put files(tFolder) into tList
> filter tList with pattern "*.(jpe?g|png|gif)"
> answer tList
> end mouseUp
>
> tList = EMPTY, I made of course sure there are JPG, PNG and GIF files in that 
> folder.
>
> Same when I use:
> ...
> filter lines of tList with pattern "*.(jpe?g|png|gif)"
> ...
> Any clues?
>
> > Thanks,
>
> You're welcome! :-)
>
> > Brian
> > On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode 
> > , wrote:
> > > Hi friends,
> > >
> > > I know how to:
> > > ...
> > > filter list_of_files with "*.jpg"
> > > ...
> > > But REGEX stuff is way over my head. :-/ Can anyone provide the 
> > > regex/pattern syntax for filtering jpg, png etc. in ONE run? Know 
> > > what I mean?
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://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


___
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 Klaus major-k via use-livecode
Hi Brian,

> Am 17.08.2018 um 15:19 schrieb Brian Milby via use-livecode 
> :
> 
> RegEx pattern
> Sorry, I was just giving the pattern, not the syntax.
> Also, it will probably be case sensitive in that format.

My suffixes are all lower case, so this shouldn't matter here.

> I won’t be able to test until later. I don’t recall the case insensitive flag 
> off hand.

No joy :-/

If I use:
...
filter tList with regex pattern "*.(jpe?g|png|gif)"
...
or
...
filter lines of tList with regex pattern "*.(jpe?g|png|gif)"
...
I get an error: 
button "Button": execution error at line 8 (matchChunk: error in pattern 
expression), char 1

> Thanks,
> Brian

Best

Klaus

--
Klaus Major
http://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 list_of_files with REGEX xyz?

2018-08-17 Thread Brian Milby via use-livecode
RegEx pattern
Sorry, I was just giving the pattern, not the syntax.
Also, it will probably be case sensitive in that format. I won’t be able to 
test until later. I don’t recall the case insensitive flag off hand.

Thanks,
Brian
On Aug 17, 2018, 8:15 AM -0500, Klaus major-k via use-livecode 
, wrote:
> Hi Brian,
>
> > Am 17.08.2018 um 14:40 schrieb Brian Milby via use-livecode 
> > :
> >
> > Pattern “*.(jpe?g|png|gif)”
>
> thanks, but that does not work!?
>
> I tried:
> on mouseUp pMouseButton
> answer folder "sdsdsdsd"
> put it into tFolder
> put files(tFolder) into tList
> filter tList with pattern "*.(jpe?g|png|gif)"
> answer tList
> end mouseUp
>
> tList = EMPTY, I made of course sure there are JPG, PNG and GIF files in that 
> folder.
>
> Same when I use:
> ...
> filter lines of tList with pattern "*.(jpe?g|png|gif)"
> ...
> Any clues?
>
> > Thanks,
>
> You're welcome! :-)
>
> > Brian
> > On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode 
> > , wrote:
> > > Hi friends,
> > >
> > > I know how to:
> > > ...
> > > filter list_of_files with "*.jpg"
> > > ...
> > > But REGEX stuff is way over my head. :-/
> > > Can anyone provide the regex/pattern syntax for filtering
> > > jpg, png etc. in ONE run? Know what I mean?
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://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 list_of_files with REGEX xyz?

2018-08-17 Thread Klaus major-k via use-livecode
Hi Brian,

> Am 17.08.2018 um 14:40 schrieb Brian Milby via use-livecode 
> :
> 
> Pattern “*.(jpe?g|png|gif)”

thanks, but that does not work!?

I tried:
on mouseUp pMouseButton
 answer folder "sdsdsdsd"
 put it into tFolder
 put files(tFolder) into tList
 filter tList with pattern "*.(jpe?g|png|gif)"
 answer tList
end mouseUp

tList = EMPTY, I made of course sure there are JPG, PNG and GIF files in that 
folder.

Same when I use:
...
filter lines of tList with pattern "*.(jpe?g|png|gif)"
...
Any clues?

> Thanks,

You're welcome! :-)

> Brian
> On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode 
> , wrote:
>> Hi friends,
>> 
>> I know how to:
>> ...
>> filter list_of_files with "*.jpg"
>> ...
>> But REGEX stuff is way over my head. :-/
>> Can anyone provide the regex/pattern syntax for filtering
>> jpg, png etc. in ONE run? Know what I mean?

Best

Klaus

--
Klaus Major
http://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 list_of_files with REGEX xyz?

2018-08-17 Thread Brian Milby via use-livecode
Pattern “*.(jpe?g|png|gif)”

Thanks,
Brian
On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode 
, wrote:
> Hi friends,
>
> I know how to:
> ...
> filter list_of_files with "*.jpg"
> ...
> But REGEX stuff is way over my head. :-/
>
> Can anyone provide the regex/pattern syntax for filtering
> jpg, png etc. in ONE run? Know what I mean?
>
> Thanks a lot in advance!
>
>
> Best
>
> Klaus
> --
> Klaus Major
> http://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? replace? wildcard? reg exp? help please!

2017-05-19 Thread Thierry Douez via use-livecode
​

Is there life without internet for one week?

- lucky you are connected to the world again!
> Tiemo
>

​Hallo Tiemo,

Except some hurdles with the administration ( sold my old car and bought a
new one) plus being insulted by a couple of stressed and egotist people for
not answering sooner,
I did use this time to clean my garden,
did some house construction and enjoyed
to talk longer with friends in the city :)

But I'll have to work all the week-end now :)

Kind regards,

Thierry
​

> >
> >> put "1 [A] 2 [B] 3." into tText
> >> put  removeBrackets( tText)
> >>
> >
> > I see that the middle section is omitted with my regex, so I forgot to
> > make it non-greedy. But I've forgotten how to do that, something about
> > a question mark, I think?
>
>
> ​Sorry about the delay, we had a thunderstorm which broke all Internet
> network in our area since last Friday.
>
> You can do this in 2 ways:
>
> - make your .* non greedy by adding a '?' suffix
>
> - or modify your regex this way:
>
>"\[ [^\]]*]" which means looking for an open bracket followed by zero
> to any number of chars which are not a close bracket, and last a close
> bracket.
> BTW, no need to escape the last closing bracket; the regex engine is smart
> enough.
>
>
> PCRE library accepts the 2 forms.
>
> HTH,
>
> Thierry
>  ​
>

-- 

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
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? replace? wildcard? reg exp? help please!

2017-05-19 Thread Thierry Douez via use-livecode
>
>
>> put "1 [A] 2 [B] 3." into tText
>> put  removeBrackets( tText)
>>
>
> I see that the middle section is omitted with my regex, so I forgot to
> make it non-greedy. But I've forgotten how to do that, something about a
> question mark, I think?


​Sorry about the delay, we had a thunderstorm which broke all Internet
network
in our area since last Friday.

You can do this in 2 ways:

- make your .* non greedy by adding a '?' suffix

- or modify your regex this way:

   "\[ [^\]]*]" which means looking for an open bracket followed by zero to
any number of chars which are not a close bracket, and last a close bracket.
BTW, no need to escape the last closing bracket; the regex engine is smart
enough.


PCRE library accepts the 2 forms.

HTH,

Thierry
​
-- 

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
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? replace? wildcard? reg exp? help please!

2017-05-12 Thread J. Landman Gay via use-livecode

On 5/12/17 3:37 PM, Thierry Douez via use-livecode wrote:

This should be a one-line command!
I've typed this post with the new Opera browser
???


Another try with 2 lines:

put "1 [A] 2 [B] 3." into tText
put  removeBrackets( tText)

​Better?


Yes. It's odd that a browser would reformat it that way.

I see that the middle section is omitted with my regex, so I forgot to 
make it non-greedy. But I've forgotten how to do that, something about a 
question mark, I think?


--
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? replace? wildcard? reg exp? help please!

2017-05-12 Thread Thierry Douez via use-livecode
>
>
>>
>>
>>> function removeBrackets pString
>>>   return replacetext(pString,"\[.*\]",empty)
>>> end removeBrackets
>>>
>> ​​
>>
>> What would be the result of next  line:?
>>
>> *put* removeBrackets
>> ​( ​
>> "1 [A] 2 [B] 3."
>> ​)
>>
>
> An error. I did warn about my limited regex skills. :)

So what should it be?
>
> Also, that's a non-standard format for a function.

I've never seen it written that way before.


​

This should be a one-line command!
I've typed this post with the new Opera browser
???


Another try with 2 lines:

put "1 [A] 2 [B] 3." into tText
put  removeBrackets( tText)

​Better?

Thierry​



Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
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? replace? wildcard? reg exp? help please!

2017-05-12 Thread J. Landman Gay via use-livecode

On 5/12/17 2:08 AM, Thierry Douez via use-livecode wrote:

​Hi,





function removeBrackets pString
  return replacetext(pString,"\[.*\]",empty)
end removeBrackets



​​

What would be the result of next  line:?

*put* removeBrackets
​( ​
"1 [A] 2 [B] 3."
​)


An error. I did warn about my limited regex skills. :) So what should it be?

Also, that's a non-standard format for a function. I've never seen it 
written that way before.


--
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? replace? wildcard? reg exp? help please!

2017-05-12 Thread Thierry Douez via use-livecode
​Hi,



>
> function removeBrackets pString
>   return replacetext(pString,"\[.*\]",empty)
> end removeBrackets
>
>
​​

What would be the result of next  line:?

*put* removeBrackets
​( ​
"1 [A] 2 [B] 3."
​)


Kind regards,

Thierry
​

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
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? replace? wildcard? reg exp? help please!

2017-05-10 Thread Nicolas Cueto via use-livecode
> Totally OT, but is this Dante, in Spanish??

Yes, and yes. From the verse translation of Ángel Crespo.

--
Nicolas Cueto

On 10 May 2017 at 19:57, Graham Samuel via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Totally OT, but is this Dante, in Spanish??
>
> Just askin’. I am not good with languages, as you can probably tell.
>
> Graham
>
> > On 10 May 2017, at 06:33, J. Landman Gay via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > On 5/9/17 11:16 PM, J. Landman Gay via use-livecode wrote:
> >> On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:
> >>> Given this snippet...
> >>>
> >>> ---
> >>> CANTO XXXIV
> >>> CÍRCULO IX: TRAIDORES.
> >>> «Vexilla regis prodeunt[307] del Abismo
> >>> hacia nosotros[308], mas delante mira
> >>> 3—dijo el maestro— y los verás tú mismo.»
> >>> ---
> >>>
> >>> ... how do I use LC to remove the square-brackets and any string within
> >>> them, so that the snippet becomes...
> >>>
> >>> ---
> >>> CANTO XXXIV
> >>> CÍRCULO IX: TRAIDORES.
> >>> «Vexilla regis prodeunt del Abismo
> >>> hacia nosotros, mas delante mira
> >>> 3—dijo el maestro— y los verás tú mismo.»
> >>> ---
> >>
> >> This is about the only thing I know how to do with regext. :)
> >>
> >> on fix
> >>  put fld 1 into tText
> >>  put "\[.*\]" into tRegEx
> >>  put replacetext(tText,tRegEx,empty) into fld 2
> >> end fix
> >>
> >
> > You'd probably want it to be a function though:
> >
> > function removeBrackets pString
> >  return replacetext(pString,"\[.*\]",empty)
> > end removeBrackets
> >
> > --
> > 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? replace? wildcard? reg exp? help please!

2017-05-10 Thread Graham Samuel via use-livecode
Totally OT, but is this Dante, in Spanish??

Just askin’. I am not good with languages, as you can probably tell.

Graham

> On 10 May 2017, at 06:33, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 5/9/17 11:16 PM, J. Landman Gay via use-livecode wrote:
>> On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:
>>> Given this snippet...
>>> 
>>> ---
>>> CANTO XXXIV
>>> CÍRCULO IX: TRAIDORES.
>>> «Vexilla regis prodeunt[307] del Abismo
>>> hacia nosotros[308], mas delante mira
>>> 3—dijo el maestro— y los verás tú mismo.»
>>> ---
>>> 
>>> ... how do I use LC to remove the square-brackets and any string within
>>> them, so that the snippet becomes...
>>> 
>>> ---
>>> CANTO XXXIV
>>> CÍRCULO IX: TRAIDORES.
>>> «Vexilla regis prodeunt del Abismo
>>> hacia nosotros, mas delante mira
>>> 3—dijo el maestro— y los verás tú mismo.»
>>> ---
>> 
>> This is about the only thing I know how to do with regext. :)
>> 
>> on fix
>>  put fld 1 into tText
>>  put "\[.*\]" into tRegEx
>>  put replacetext(tText,tRegEx,empty) into fld 2
>> end fix
>> 
> 
> You'd probably want it to be a function though:
> 
> function removeBrackets pString
>  return replacetext(pString,"\[.*\]",empty)
> end removeBrackets
> 
> -- 
> 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? replace? wildcard? reg exp? help please!

2017-05-09 Thread J. Landman Gay via use-livecode

On 5/9/17 11:16 PM, J. Landman Gay via use-livecode wrote:

On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:

Given this snippet...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt[307] del Abismo
hacia nosotros[308], mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

... how do I use LC to remove the square-brackets and any string within
them, so that the snippet becomes...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt del Abismo
hacia nosotros, mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---


This is about the only thing I know how to do with regext. :)

on fix
  put fld 1 into tText
  put "\[.*\]" into tRegEx
  put replacetext(tText,tRegEx,empty) into fld 2
end fix



You'd probably want it to be a function though:

function removeBrackets pString
  return replacetext(pString,"\[.*\]",empty)
end removeBrackets

--
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? replace? wildcard? reg exp? help please!

2017-05-09 Thread Nicolas Cueto via use-livecode
​Thank you everyone. Went with ​Jacqueline's, cause fastest.

--
N. Cueto
___
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? replace? wildcard? reg exp? help please!

2017-05-09 Thread J. Landman Gay via use-livecode

On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:

Given this snippet...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt[307] del Abismo
hacia nosotros[308], mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

... how do I use LC to remove the square-brackets and any string within
them, so that the snippet becomes...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt del Abismo
hacia nosotros, mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---


This is about the only thing I know how to do with regext. :)

on fix
  put fld 1 into tText
  put "\[.*\]" into tRegEx
  put replacetext(tText,tRegEx,empty) into fld 2
end fix

--
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? replace? wildcard? reg exp? help please!

2017-05-09 Thread Phil Davis via use-livecode

There is probably an easier way, but this works:

   on mouseUp
put "]" & field 1 into tText
set the lineDelimiter to "["
set the itemDelimiter to "]"
repeat for each line tLine in tText
put item 2 to -1 of tLine after tNewText
end repeat
put tNewText into field 2
   end mouseUp

HTH -
Phil Davis


On 5/9/17 8:41 PM, Nicolas Cueto via use-livecode wrote:

Given this snippet...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt[307] del Abismo
hacia nosotros[308], mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

... how do I use LC to remove the square-brackets and any string within
them, so that the snippet becomes...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt del Abismo
hacia nosotros, mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

Muchas gracias.

--
Nicolás Cueto
___
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


--
Phil Davis

___
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? replace? wildcard? reg exp? help please!

2017-05-09 Thread Peter Bogdanoff via use-livecode
Try—
put your text into tText, then

repeat forever
if offset("[",tText) is not empty then
delete char (offset("[",tText)) to (offset("]",tText)) of tText
else
exit repeat
end repeat



On May 9, 2017, at 8:54 PM, Peter Bogdanoff via use-livecode 
 wrote:

> use offset.
> 
> Peter
> 
> 
> On May 9, 2017, at 8:41 PM, Nicolas Cueto via use-livecode 
>  wrote:
> 
>> Given this snippet...
>> 
>> ---
>> CANTO XXXIV
>> CÍRCULO IX: TRAIDORES.
>> «Vexilla regis prodeunt[307] del Abismo
>> hacia nosotros[308], mas delante mira
>> 3—dijo el maestro— y los verás tú mismo.»
>> ---
>> 
>> ... how do I use LC to remove the square-brackets and any string within
>> them, so that the snippet becomes...
>> 
>> ---
>> CANTO XXXIV
>> CÍRCULO IX: TRAIDORES.
>> «Vexilla regis prodeunt del Abismo
>> hacia nosotros, mas delante mira
>> 3—dijo el maestro— y los verás tú mismo.»
>> ---
>> 
>> Muchas gracias.
>> 
>> --
>> Nicolás Cueto
>> ___
>> 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? replace? wildcard? reg exp? help please!

2017-05-09 Thread Peter Bogdanoff via use-livecode
use offset.

Peter


On May 9, 2017, at 8:41 PM, Nicolas Cueto via use-livecode 
 wrote:

> Given this snippet...
> 
> ---
> CANTO XXXIV
> CÍRCULO IX: TRAIDORES.
> «Vexilla regis prodeunt[307] del Abismo
> hacia nosotros[308], mas delante mira
> 3—dijo el maestro— y los verás tú mismo.»
> ---
> 
> ... how do I use LC to remove the square-brackets and any string within
> them, so that the snippet becomes...
> 
> ---
> CANTO XXXIV
> CÍRCULO IX: TRAIDORES.
> «Vexilla regis prodeunt del Abismo
> hacia nosotros, mas delante mira
> 3—dijo el maestro— y los verás tú mismo.»
> ---
> 
> Muchas gracias.
> 
> --
> Nicolás Cueto
> ___
> 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 lines of a variable that start with...

2014-05-03 Thread Keith Clarke
…of course, it would have helped if I’d added the “*” wild card to the end of 
the filter - doh! :-)

 filter tSearchResultsHTML withli*

Best,
Keith..

On 3 May 2014, at 15:14, Keith Clarke keith.cla...@clarkeandclarke.co.uk 
wrote:

 Hi folks,
 I’m working on a little utility to analyse Google search results and I’m 
 trying to isolate just the results list (which sit in an unordered list) form 
 the rest of the HTML page source noise.
 
 I wanted to filter lines with the first 3 chars are “li” but I’m struggling 
 to get the basic 'filter lines with” function to behave. The first line of 
 this script seems to be successfully inserting returns before the opening 
 li…  tags. I’ve checked this by putting the result in the message box and 
 also copying  pasting the resulting content into a text editor. However, the 
 second line - which is meant to remove any lines that don’t contain the 
 opening li… tag - is currently behaving as if the line breaks haven’t been 
 inserted.
 
 Currently the effect of the second line is that the output 
 ‘SearchResultsList' field shows:
 Nothing when the filter is in its ‘with’ form - as shown
 All lines in the source when in its ‘without’ form
 
replace li with (return  li) in tSearchResultsHTML
filter lines of tSearchResultsHTML with li
put tSearchResultsHTML into field SearchResultsList” 
 
 I’ve tried setting the rowDelimiter to return with no effect. Any clues on 
 where this logic is broken?
 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 appears to work differently when single stepping

2013-09-12 Thread Klaus major-k
Hi Richard,

Am 12.09.2013 um 18:26 schrieb Dr. Hawkins doch...@gmail.com:

 I have a global dhUpCds for a list of long names of cards that get
 updated.  When a card closes, I want them removed
 
 I made a handler
 
on dhRmUpCd oldCd
  global dhUpCds
 
   ## Try with parens:
   filter dhUpCds without (*  oldCd)
end dhRmUpCd

 This is designed to accept either a card name or stack name.
 
 I'm finding that it always works as expected when single stepping in
 the IDE, but that the filtering does not work all of the time when
 running.  Even single stepping to that point and hitting the blue run
 button seems to leave the command unprocessed.
 
 -- 
 Dr. Richard E. Hawkins, Esq.
 (702) 508-8462

Best

Klaus

--
Klaus Major
http://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 appears to work differently when single stepping

2013-09-12 Thread Dr. Hawkins
On Thu, Sep 12, 2013 at 9:32 AM, Klaus major-k kl...@major-k.de wrote:

## Try with parens:
filter dhUpCds without (*  oldCd)

Thanks.  THis may have done it.

It also seems that the watch window for my variable does not get
updated after the last iteration until I click on another window--even
though it has focus neither before or after . . .

grr.




-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462

___
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 a tab character

2013-02-04 Thread Klaus on-rev
Hi Hugh,

Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com 
ad...@flexiblelearning.com:

 I have tab-delimited list and am trying to filter lines.
 
 
 Q1. How do we include a TAB character in the expression? Using filter with
 *\tsomeText fails.

use the contant TAB:
...
filter tList with (*  TAB  whatever)
...

 Q2. How do we specify a maximum numeric value? Using filter with *[18]
 fails.

Sorry, no idea. 
Maybe with some RegeEx?

 Have tried reading up on Bourne Shell but am totally confused!
 
 Thanks.
 
 Hugh Senior
 FLCo

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major.on-rev.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 with a tab character

2013-02-04 Thread Richard Gaskin

Klaus wrote:

Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com:


I have tab-delimited list and am trying to filter lines.

Q1. How do we include a TAB character in the expression? Using filter with
*\tsomeText fails.


use the contant TAB:
...
filter tList with (*  TAB  whatever)



While the filter command is seductively simple to use, if your rows have 
many columns and you're filtering on one several columns in, you may 
find repeat for each will be more efficient:


http://article.gmane.org/gmane.comp.ide.revolution.user/72192/match=filter+tab+gaskin


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 Follow me on Twitter:  http://twitter.com/FourthWorldSys

___
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 a tab character

2013-02-04 Thread Mike Bonner
I think you could also use \t to signify a tab char.

As for the matching a range of numbers you'd probably be better served to
have lc handle whatever is leftover. However, barring that, you might look
at this page: http://www.regular-expressions.info/numericranges.html for an
explanation of how to get it done.


On Mon, Feb 4, 2013 at 10:09 AM, Klaus on-rev kl...@major.on-rev.comwrote:

 Hi Hugh,

 Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com
 ad...@flexiblelearning.com:

  I have tab-delimited list and am trying to filter lines.
 
 
  Q1. How do we include a TAB character in the expression? Using filter
 with
  *\tsomeText fails.

 use the contant TAB:
 ...
 filter tList with (*  TAB  whatever)
 ...

  Q2. How do we specify a maximum numeric value? Using filter with *[18]
  fails.

 Sorry, no idea.
 Maybe with some RegeEx?

  Have tried reading up on Bourne Shell but am totally confused!
 
  Thanks.
 
  Hugh Senior
  FLCo

 Best

 Klaus

 --
 Klaus Major
 http://www.major-k.de
 kl...@major.on-rev.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 with a tab character

2013-02-04 Thread Paul Hibbert
filter searches for a pattern, not a value, so this can work to filter anything 
'less than 18', but would work to filter results with the chars , 1 or 8.

Paul

On 2013-02-04, at 9:04 AM, FlexibleLearning.com wrote:

 Q2. How do we specify a maximum numeric value? Using filter with *[18]
 fails.


___
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 a tab character

2013-02-04 Thread Paul Hibbert
Sorry, that should have read can't work not can work.

On 2013-02-04, at 9:48 AM, Paul Hibbert wrote:

 filter searches for a pattern, not a value, so this can work to filter 
 anything 'less than 18', but would work to filter results with the chars , 
 1 or 8.
 
 Paul
 
 On 2013-02-04, at 9:04 AM, FlexibleLearning.com wrote:
 
 Q2. How do we specify a maximum numeric value? Using filter with *[18]
 fails.
 
 
 ___
 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 a tab character

2013-02-04 Thread Thierry Douez
2013/2/4 FlexibleLearning.com ad...@flexiblelearning.com

 I have tab-delimited list and am trying to filter lines.

 Q1. How do we include a TAB character in the expression? Using filter with
 *\tsomeText fails.


see \s below



 Q2. How do we specify a maximum numeric value? Using filter with *[18]
 fails.



on mouseUp
   local tmp
   put fld 1 into tList
   -- \s match space and tab
   -- get \s[0-9]\s -- any 0 to 9 single number
   -- get \s[1-4][0-9]\s -- accept  10 to 49
   -- get \s[1-4]\d\s -- accept  10 to 49
   -- get \s[1-4]?\d\s -- accept  0 to 49
   get \s[1-4]?(\d){1,3}\s -- accept  0 to 4999
   repeat for each line L in tList
  if matchText( L, IT ) then put L cr after tmp
   end repeat
   put tmp
end mouseUp

Forget about filter; it doesn't play with regex, just sort of...

my fld test contains:

hjkdf sdfsdflkj 987dsf sdf sdf
fgffg gf gf4998 fd ddf ddfd
fgffg gf gf5000 fd ddf ddfd
ere e re 1234567890e
gfgjfkgf dfglwer 0 fdfsla sdfsdf
gfgjfkgf dfglwer 42fdfsla sdfsdf
try tytry retert  41dfsdffdsd
sdflk; asdf 33dfdfdfsa dsfsdff
kjklj jlkjlk 7ljlkj lkjkjlkj jljljkl


And it's fast.

HTH,

Thierry
___
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 a tab character

2013-02-04 Thread Thierry Douez
Forgot one  which maybe you need:

   get \s([1-3]?\d|[4][0-2])\s -- accept 0 to 42

Regards,

Thierry


2013/2/4 Thierry Douez th.do...@gmail.com


 2013/2/4 FlexibleLearning.com ad...@flexiblelearning.com

 I have tab-delimited list and am trying to filter lines.

 Q1. How do we include a TAB character in the expression? Using filter with
 *\tsomeText fails.


 see \s below



 Q2. How do we specify a maximum numeric value? Using filter with *[18]
 fails.



 on mouseUp
local tmp
put fld 1 into tList
-- \s match space and tab
-- get \s[0-9]\s -- any 0 to 9 single number
-- get \s[1-4][0-9]\s -- accept  10 to 49
-- get \s[1-4]\d\s -- accept  10 to 49
-- get \s[1-4]?\d\s -- accept  0 to 49
get \s[1-4]?(\d){1,3}\s -- accept  0 to 4999
repeat for each line L in tList
   if matchText( L, IT ) then put L cr after tmp
end repeat
put tmp
 end mouseUp

 Forget about filter; it doesn't play with regex, just sort of...

 my fld test contains:

 hjkdf sdfsdflkj 987dsf sdf sdf
 fgffg gf gf4998 fd ddf ddfd
 fgffg gf gf5000 fd ddf ddfd
 ere e re 1234567890e
 gfgjfkgf dfglwer 0 fdfsla sdfsdf
 gfgjfkgf dfglwer 42fdfsla sdfsdf
 try tytry retert  41dfsdffdsd
 sdflk; asdf 33dfdfdfsa dsfsdff
 kjklj jlkjlk 7ljlkj lkjkjlkj jljljkl


 And it's fast.

 HTH,

 Thierry


___
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 a tab character

2013-02-04 Thread FlexibleLearning.com
Thanks for the insights. Much appreciated.

The list to filter is not enormous, but the 'for each' option would also
handle any numeric evaluations, so both solutions will be valuable.

Hugh Senior
FLCo



Klaus wrote:
 Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com:

 I have tab-delimited list and am trying to filter lines.

 Q1. How do we include a TAB character in the expression? Using filter
with
 *\tsomeText fails.

 use the contant TAB:
 ...
 filter tList with (*  TAB  whatever)

Richard wrote:
While the filter command is seductively simple to use, if your rows have
many columns and you're filtering on one several columns in, you may
find repeat for each will be more efficient:

http://article.gmane.org/gmane.comp.ide.revolution.user/72192/match=filter
+tab+gaskin


___
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 and the Question Mark (escaping ? in regex)

2013-01-24 Thread Thierry Douez
Hi Bob,

You are wrong and right :)

Right because that's how regex works in most  environment.

Wrong because regex inside Livecode behave sometimes in strange ways...

Anyway, be happy.

Thierry


2013/1/23 Robert Sneidar slylab...@me.com

 I mean Thierry

  I just checked this, and Malte is correct. I see now why the second
 example would only select lines ending in ?. I should probably remove
 expert in regex from my resume? ;-)
 
  Bob
 
 
  On Jan 23, 2013, at 3:30 AM, Thierry Douez wrote:
 
  Hi Malte,
 
  for any position of ? in a line:  filter tText with *[?]*
 
  for the last char of a line:  filter tText with *[?]
 
  Regards,
  Thierry

___
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 and the Question Mark (escaping ? in regex)

2013-01-23 Thread Mark Schonewille

Malte,

Try this:

   filter tText with *[?]*

Kind regards,

Mark



On 1/23/2013 11:49 AM, Malte Brill wrote:

Hi,

I got a var tText that contains:

asdf
jkl?
bcdk

I want to do something like this

filter tText with *\?*

which should leave me with only jkl?. This does not appear to work. Any 
pointers on how to correctly escape the question mark greatly appreciated.

Cheers,

Malte


___
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 and the Question Mark (escaping ? in regex)

2013-01-23 Thread Thierry Douez
Hi Malte,

for any position of ? in a line:  filter tText with *[?]*

for the last char of a line:  filter tText with *[?]

Regards,

Thierry


2013/1/23 Malte Brill revolut...@derbrill.de

 Hi,

 I got a var tText that contains:

 asdf
 jkl?
 bcdk

 I want to do something like this

 filter tText with *\?*

 which should leave me with only jkl?.


___
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 and the Question Mark (escaping ? in regex)

2013-01-23 Thread Robert Sneidar
It's my understanding that * means 0 to any number of characters, in which case 
these are both the same thing. I might be wrong though. Might explain why some 
of my filtering is not working as expected. :-)

Bob


On Jan 23, 2013, at 3:30 AM, Thierry Douez wrote:

 Hi Malte,
 
 for any position of ? in a line:  filter tText with *[?]*
 
 for the last char of a line:  filter tText with *[?]
 
 Regards,
 
 Thierry
 
 
 2013/1/23 Malte Brill revolut...@derbrill.de
 
 Hi,
 
 I got a var tText that contains:
 
 asdf
 jkl?
 bcdk
 
 I want to do something like this
 
 filter tText with *\?*
 
 which should leave me with only jkl?.
 
 
 ___
 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 and the Question Mark (escaping ? in regex)

2013-01-23 Thread Robert Sneidar
I just checked this, and Malte is correct. I see now why the second example 
would only select lines ending in ?. I should probably remove expert in regex 
from my resume? ;-)

Bob


On Jan 23, 2013, at 3:30 AM, Thierry Douez wrote:

 Hi Malte,
 
 for any position of ? in a line:  filter tText with *[?]*
 
 for the last char of a line:  filter tText with *[?]
 
 Regards,
 
 Thierry
 
 
 2013/1/23 Malte Brill revolut...@derbrill.de
 
 Hi,
 
 I got a var tText that contains:
 
 asdf
 jkl?
 bcdk
 
 I want to do something like this
 
 filter tText with *\?*
 
 which should leave me with only jkl?.
 
 
 ___
 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 and the Question Mark (escaping ? in regex)

2013-01-23 Thread Robert Sneidar
I mean Thierry

 I just checked this, and Malte is correct. I see now why the second example 
 would only select lines ending in ?. I should probably remove expert in 
 regex from my resume? ;-)
 
 Bob
 
 
 On Jan 23, 2013, at 3:30 AM, Thierry Douez wrote:
 
 Hi Malte,
 
 for any position of ? in a line:  filter tText with *[?]*
 
 for the last char of a line:  filter tText with *[?]
 
 Regards,
 
 Thierry
 


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

2012-03-14 Thread Pete
Duh!! Thank you Terry.
Pete

On Tue, Mar 13, 2012 at 9:35 PM, Terry Judd terry.j...@unimelb.edu.auwrote:


 On 14/03/2012, at 02:52 PM, Pete wrote:

 Unless I'm doing something wrong, filter tvar without tab doesn't work,
 that is the lines with a tab remain in tvar after the filter command.

 Suer would be nice to have that work when dynamically building the contents
 of a popup menu with indented lines in it...

 That would only work if the lines you wanted to filter out only contained
 a tab character. If they contain other stuff then you need one of the
 following...

 filter tvar without (*tab*) -- if the tab can be anywhere in the line
 filter tvar without (tab*) -- if the tab is at the start of the line, or
 filter tvar without (*tab) -- if the tab is at the end of the line

 Terry...

 --
 Pete
 Molly's Revenge http://www.mollysrevenge.com
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.commailto: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


 Dr Terry Judd
 Senior Lecturer in Medical Education
 Medical Eduction Unit
 Faculty of Medicine, Dentistry  Health Sciences
 The University of Melbourne



 ___
 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




-- 
Pete
Molly's Revenge http://www.mollysrevenge.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 probelm

2012-03-13 Thread Terry Judd

On 14/03/2012, at 02:52 PM, Pete wrote:

Unless I'm doing something wrong, filter tvar without tab doesn't work,
that is the lines with a tab remain in tvar after the filter command.

Suer would be nice to have that work when dynamically building the contents
of a popup menu with indented lines in it...

That would only work if the lines you wanted to filter out only contained a tab 
character. If they contain other stuff then you need one of the following...

filter tvar without (*tab*) -- if the tab can be anywhere in the line
filter tvar without (tab*) -- if the tab is at the start of the line, or
filter tvar without (*tab) -- if the tab is at the end of the line

Terry...

--
Pete
Molly's Revenge http://www.mollysrevenge.com
___
use-livecode mailing list
use-livecode@lists.runrev.commailto: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


Dr Terry Judd
Senior Lecturer in Medical Education
Medical Eduction Unit
Faculty of Medicine, Dentistry  Health Sciences
The University of Melbourne



___
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 (was Re: Using DropBox for Faster Mobile Development)

2012-02-23 Thread Bob Sneidar
I could have accepted the behavior if it was the last line that passed the 
filter results, and because it did not contain a cr, the result did not end in 
a cr. But for the filtered results to not have the cr in ANY results regardless 
of whether or not the last line was included in the results would mean that the 
filter command is programmed to look to see if there is a trailing cr and then 
include on in ANY filter results or exclude one in ANY filter results based 
upon that! What sane reason is there for that??? It may as well check to see if 
the last char is a tab and so return a tab delimited list! 

Bob


On Feb 23, 2012, at 1:08 PM, Ben Rubinstein wrote:

 Bob,
 
 I think this may indeed be a matter of perception, and therefore not one with 
 a right or wrong answer!
 
 But I think there absolutely _is_ a difference between terminate and delimit. 
 And I've found from experience that some LC developers think of line 
 formatted lists as a series of lines delimited by return (and I see in their 
 code care being taken to avoid a final return, which would be redundant in 
 that model when there's nothing to delimit); while others think of line 
 formatted lists as a series of lines each terminated by return (and therefore 
 their code takes equal pains to ensure that there's always a return at the 
 end).
 
 One might say that the nice thing is that FILTER allows both kinds of 
 developers to remain secure in their respective deluded belief system...
 
 I see it differently. The same command with essentially the same
 data (except for the one trailing cr) returns different results.
 
 Strictly speaking, isn't that the same command with different data returns 
 different results?
 
 Or if you prefer, the same command with essentially the same data (except 
 for the one trailing cr) returns essentially the same results (except for the 
 one trailing cr)?
 
 Ben
 
 On 21/02/2012 17:57, Bob Sneidar wrote:
 I see it differently. The same command with essentially the same data 
 (except for the one trailing cr) returns different results. The FILTER 
 command works with lines. It doesn't know from squat whether or not the 
 developer meant to terminate or delimit and simply forgot to terminate 
 the last line. In fact I am not even sure I understand the distinction. In 
 this context terminate and delimit mean the same thing. There is no 
 termination in LC that I know of.
 
 Bob
 
 ___
 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

2011-12-12 Thread Robert Brenstein

On 11.12.2011 at 23:00 Uhr -0500 dunb...@aol.com apparently wrote:
I can do this the long way, but is there a clever sortkey that will 
sort lines by the length of those lines?




something along this should work:

sort lines of myVar numeric by length of each

Robert

___
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

2011-12-12 Thread Bob Sneidar
Worked for me.

on mouseUp pMouseBtnNo
put field Field into myVar
sort myVar numeric by the length of each
put myVar into field Field
end mouseUp

Bob


On Dec 11, 2011, at 8:00 PM, dunb...@aol.com wrote:

 I can do this the long way, but is there a clever sortkey that will sort 
 lines by the length of those lines?
 
 
 In other words, if I have a variable myVar with:
 
 
 aaa
 xxx
 
 
 
 I want to write something like:
 
 
 sort myVar by the length of each
 
 
 to yield:
 
 
 xxx
 
 
 aaa
 
 
 Thanks,
 
 
 Craig Newman
 ___
 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

2011-12-11 Thread dunbarx
I can do this the long way, but is there a clever sortkey that will sort lines 
by the length of those lines?


In other words, if I have a variable myVar with:


aaa
xxx



I want to write something like:


sort myVar by the length of each


to yield:


xxx


aaa


Thanks,


Craig Newman
___
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

2011-12-09 Thread Bob Sneidar
The filter command works on the entire line. The way you are using it, only 
lines that contain only the letter C will show up. Instead, use:

filter temp with *c*

Bob


On Dec 9, 2011, at 11:15 AM, dunb...@aol.com wrote:

 
 
 What am I doing wrong? If I have:
 on mouseup
   put abcdef into temp
   filter temp with c
   put temp
 end mouseup
 I get empty. I don't need more empty.
 Craig Newman
 
 ___
 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

2011-12-09 Thread Mark Schonewille
Hi Craig,

filter abcdef with c gives empty because abcdef is not c
filter abcdef with *c* returns abcdef because abcdef contains c.

Filter affects lines, not chars. If you want to remove all c chars in abcdef 
then you need to use the replace command:

replace c with x in abcdef
 
--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Become our partner in sales http://qery.us/1bq Start selling Color Converter 
today. 20% commission!

On 9 dec 2011, at 20:15, dunb...@aol.com wrote:

 
 
 What am I doing wrong? If I have:
 on mouseup
   put abcdef into temp
   filter temp with c
   put temp
 end mouseup
 I get empty. I don't need more empty.
 Craig Newman


___
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

2011-12-09 Thread Pete
Hi Craig,
I think filter works on lines not chars so if you want to include lines
containing c do:

filter temp with *c*

The * is a placeholder for zero or more characters.

On Fri, Dec 9, 2011 at 11:15 AM, dunb...@aol.com wrote:



 What am I doing wrong? If I have:
 on mouseup
   put abcdef into temp
   filter temp with c
   put temp
 end mouseup
 I get empty. I don't need more empty.
 Craig Newman

 ___
 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




-- 
Pete
Molly's Revenge http://www.mollysrevenge.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

2011-12-09 Thread Bob Sneidar
BTW you will get the contents of the entire line by using filter temp with 
*c*. As I mentioned it works with entire lines, not chunks of text. 

If you are trying to see if abcdef contains c use c is in abcdef. If 
you are trying to find which character contains the first c use offset(c, 
abcdef). If you are trying to find ALL the c's in the string it gets 
trickier. If the string HAS to be formatted that way, then you will need a 
repeat loop. 

put 0 into theCount
put abcdef into theString
repeat for each char theChar in theString
  add one to theCount
  if theChar is c then
put theCount  comma after thePositionList
  end if
end repeat
delete the last char of thePositionList

optionally you could do this:

put abcdef into theString
repeat for each char theChar in theString
  put theChar  cr after theNewString
end repeat

filter theNewString with c


I can't think of how that would be useful, but I don't know what you are doing. 

Bob


On Dec 9, 2011, at 11:15 AM, dunb...@aol.com wrote:

 
 
 What am I doing wrong? If I have:
 on mouseup
   put abcdef into temp
   filter temp with c
   put temp
 end mouseup
 I get empty. I don't need more empty.
 Craig Newman
 
 ___
 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

2011-12-09 Thread Peter M. Brigham, MD
On Dec 9, 2011, at 2:31 PM, Bob Sneidar wrote:

 ... If you are trying to find ALL the c's in the string it gets trickier

For that, use this:

function offsets str,ctr
   -- returns a comma-delimited list of all the offsets of str in ctr
   put  into offsetList
   put 0 into startPoint
   repeat
  put offset(str,ctr,startPoint) into os
  if os = 0 then exit repeat
  add os to startPoint
  put startPoint  , after offsetList
   end repeat
   if char -1 of offsetList = , then delete last char of mosList
   if offsetList =  then return 0
   return offsetList
end offsets

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


___
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

2011-12-09 Thread dunbarx
Ah. Thanks, everyone.


I knew about the lines, the string I tested with, was, after all, a line.


But I did not get from the dictionary the power of the wildcard char *. The 
example there was A*C, and I saw that one or more chars could be between 
those outer chars. I did not appreciate the *A* syntax.


Craig Newman



-Original Message-
From: Bob Sneidar b...@twft.com
To: How to use LiveCode use-livecode@lists.runrev.com
Sent: Fri, Dec 9, 2011 9:33 am
Subject: Re: Filter


BTW you will get the contents of the entire line by using filter temp with 
*c*. As I mentioned it works with entire lines, not chunks of text. 

If you are trying to see if abcdef contains c use c is in abcdef. If 
you 
are trying to find which character contains the first c use offset(c, 
abcdef). If you are trying to find ALL the c's in the string it gets 
trickier. If the string HAS to be formatted that way, then you will need a 
repeat loop. 

put 0 into theCount
put abcdef into theString
repeat for each char theChar in theString
  add one to theCount
  if theChar is c then
put theCount  comma after thePositionList
  end if
end repeat
delete the last char of thePositionList

optionally you could do this:

put abcdef into theString
repeat for each char theChar in theString
  put theChar  cr after theNewString
end repeat

filter theNewString with c


I can't think of how that would be useful, but I don't know what you are doing. 

Bob


On Dec 9, 2011, at 11:15 AM, dunb...@aol.com wrote:

 
 
 What am I doing wrong? If I have:
 on mouseup
   put abcdef into temp
   filter temp with c
   put temp
 end mouseup
 I get empty. I don't need more empty.
 Craig Newman
 
 ___
 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

2011-12-09 Thread Dave Cragg

On 9 Dec 2011, at 19:15, dunb...@aol.com wrote:

 What am I doing wrong? If I have:
 on mouseup
   put abcdef into temp
   filter temp with c
   put temp
 end mouseup
 I get empty. I don't need more empty.

Filter works on lines. From the docs: Filters each line in a container, 
removing the lines that do or don't match a pattern.

What were you hoping to get?

Dave


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

2011-12-09 Thread J. Landman Gay

On 12/9/11 2:48 PM, dunb...@aol.com wrote:


I play scrabble seriously.


If you get an Android device, download Wordoid. You will be lost to us 
forever after that.


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

2011-06-23 Thread Pete
I may be wrong, but I don't think intersect solves the problem.  If I
understand the dictionary correctly, this will remove all the t1 keys that
do NOT match t2 keys so it does the opposite of what is needed.  Even if
intersect does remove t1 keys that DO match t2 keys, that won't help find
values in t2 that are not present in t1, so 5 in his original example would
be missed.

The sort solution seems to work but would it be necessary to set
wholeMatches to true?  If you had two lines:

100
1001

... would 100 be taken as a duplicate with wholematches set to false?  Can't
tell from the dictionary.

Pete
Molly's Revenge http://www.mollysrevenge.com




On Wed, Jun 22, 2011 at 10:02 PM, Mark Wieder mwie...@ahsoftware.netwrote:

 Dick-

 Wednesday, June 22, 2011, 9:19:57 PM, you wrote:

  Even though it may not always be the fastest, lean code has some appeal:
 there's no loop.

  function intersectionOfLists t1, t2
 split t1 by cr and tab
 split t2 by cr and tab
 intersect t1 with t2
 return the keys of t1
  end intersectionOfLists

 ! Thanks ! I was wracking my brain trying to figure out how I could
 apply split in this situation. I *completely* forgot about the
 intersect command,

 --
 -Mark Wieder
  mwie...@ahsoftware.net


 ___
 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


  1   2   >