Re: Finding matched parentheses

2013-07-28 Thread Geoff Canyon
I checked, and your solution and my strictTotalMatching function return
identical results. It took me a while to figure out how it works. It's very
clever, but interestingly, not very efficient -- it almost certainly
doesn't matter for the likely use cases, but if you throw a string with a
few thousand (s and )s at it, seconds will go by before you get the result.

gc


On Fri, Jul 26, 2013 at 12:02 PM, dunb...@aol.com wrote:

 I am old fashioned. And late. I think this works:



 on mouseUp
answer findNests(fld 1)
 end mouseUp


 function findNests var
repeat with y = 1 to the number of chars in var
   if char y of var = ( then put y  return after lefts --build list
 of left paren
   if char y of var = ) then put y  return after rights --build list
 of right paren
end repeat
put 0  return before rights

repeat with y = the number of lines of lefts down to 1
   repeat with u = the number of lines of rights down to 1
  if line y of lefts  line u of rights and line y of lefts  line
 u-1 of rights then
 put line y of lefts  ,  line u of rights  return after
 accum
 delete line y of lefts
 if line u of rights  0 then delete line u of rights
  end if
   end repeat
end repeat
sort accum numeric
return accum
 end findNests


 The returned list orders the char numbers of the paired parens.


 Craig



 -Original Message-
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Fri, Jul 26, 2013 12:09 pm
 Subject: Re: Finding matched parentheses


 On Fri, Jul 26, 2013 at 12:10 AM, Thierry Douez th.do...@gmail.com
 wrote:

  But this one will work and match the first occurence:
 
if matchChunk(mystring,(\([^)]*\)).*,tstart,tEnd)
 
  Regards,
 
  Thierry
 

 Nice Thierry!  Doesn't handle nested parens though, but once again, that
 may not be a possibility in the OP's scenario.

 Pete
 lcSQL Software http://www.lcsql.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: Finding matched parentheses

2013-07-28 Thread Thierry Douez
2013/7/27 Peter Haworth p...@lcsql.com

 On Fri, Jul 26, 2013 at 10:10 AM, Thierry Douez th.do...@gmail.com
 wrote:

  There are solutions for recursive pattern matching with PCRE, but
  never being able to make them work within LC.
 

 Hi Thierry,
 If you follow the link in my post to
 Geoff, there's an example of a recursive expression.  It works great in LC
 (after removing the whitespace characters) but, as also mentioned, in my
 reply to Geoff, matchText doesn't work in circumstances where you don't
 know in advance how many capture groups will be found.



​Thanks Peter,

Well, I should have said that I didn't managed to make them work
consistently.

A couple of years ago, I spent quite some time to dig in
​ ​
regex within LC.
I
​dropped the idea of using (?R) or its derivatives because for most
practical cases
it didn't worked as expected (even crash LC) but
​those regex ​
worked in Perl scripts!
 (looks like in php it works great too).
​

​Regards,

Thierry​




Thierry Douez - http://sunny-tdz.com
Maker of 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: Replicant

2013-07-28 Thread Francis Nugent Dixon
Hi from Beautiful Brittany,

Richmond,

…. if you did not exist …..

…… we would have to invent you !

Best Regards

- Francis


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


How can I get Unicode Menu Items on Windows?

2013-07-28 Thread in...@kenjikojima.com
Hi,

It works on Mac OS, But does not work on Windows.
go to url http://kenjikojima.com/livecode/download/unicodeMenuStudy.livecode;

What's wrong?

Thanks,
--
Kenji Kojima / 小島健治
http://www.kenjikojima.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: Easier Dropbox Access

2013-07-28 Thread Guglielmo Braguglia

I'm back and ...
... *thanks to Mike Kerner*, a new version (1.04) of the phxDropboxLib, 
solving the /folder/ problem on mobile phx_DropboxWriteFile, as been 
made available still on the same link :


http://www.phoenixsea.ch/downloads/Livecode/phxDropboxLib.zip

Still thanks to Mike, also some typo in the documentation have been 
corrected :-)


/*Guglielmo Braguglia

*/
On 7/24/13 21:45 PM, Mike Kerner wrote:

I just heard from Gugliermo.  He's out this week, but will be working on
the new version next week.



___
use-livecode mailing list
use-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: How can I get Unicode Menu Items on Windows?

2013-07-28 Thread Richmond
On 07/28/2013 03:14 PM, in...@kenjikojima.com wrote:
 Hi,

 It works on Mac OS, But does not work on Windows.
 go to url http://kenjikojima.com/livecode/download/unicodeMenuStudy.livecode;

 What's wrong?

 Thanks,
 --
 Kenji Kojima / 小島健治
 http://www.kenjikojima.com/

Sorry; pictures required for this one:

http://forums.runrev.com/viewtopic.php?f=18t=16173

Richmond.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Missing APPLY button on IDE

2013-07-28 Thread Camm
Hi ,

 

On Windows 7:-

 

The Apply button is missing on the script editor in IDE ??

Also errors shown but do not go to script line number ??

 

Any clues ..

 

Regards

Camm

___
use-livecode mailing list
use-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: Missing APPLY button on IDE

2013-07-28 Thread Richmond

On 07/28/2013 04:11 PM, Camm wrote:

Hi ,

  


On Windows 7:-

  


The Apply button is missing on the script editor in IDE ??

Also errors shown but do not go to script line number ??

  


Any clues ..

  


Regards

Camm




Which version are you using?

I just had a go with LC 6.1.1 rc 1 Community on Windows 7 and had no
problem seeing the 'Apply' button.

Similarly with where the BIG RED X ends up when there is a script error.

How about posting the odd picture to the Forums : 
http://forums.runrev.com/index.php


so we can all see what you mean.

Richmond.

___
use-livecode mailing list
use-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: How can I get Unicode Menu Items on Windows?

2013-07-28 Thread in...@kenjikojima.com
Richmond,

You installed a vertical font. 
You can install regular fonts from an installer CD.
http://www.dartmouth.edu/~introjpn/00_windowsxp.html

You can show Japanese font in a field. 
But can not select menu items correctly. 
--
Kenji Kojima / 小島健治
http://www.kenjikojima.com/


On Jul 28, 2013, at 9:06 AM, Richmond wrote:

 On 07/28/2013 03:14 PM, in...@kenjikojima.com wrote:
 Hi,
 
 It works on Mac OS, But does not work on Windows.
 go to url 
 http://kenjikojima.com/livecode/download/unicodeMenuStudy.livecode;
 
 What's wrong?
 
 Thanks,
 --
 Kenji Kojima / 小島健治
 http://www.kenjikojima.com/
 
 Sorry; pictures required for this one:
 
 http://forums.runrev.com/viewtopic.php?f=18t=16173
 
 Richmond.
 
 ___
 use-livecode mailing list
 use-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: How can I get Unicode Menu Items on Windows?

2013-07-28 Thread Richmond
On 07/28/2013 06:06 PM, in...@kenjikojima.com wrote:
 Richmond,

 You installed a vertical font. 

That seems quite obvious from my screenshots; unfortunately EPSON did
not specify that those were vertical fonts.

I'm sorry; but as I have no Japanese, and almost as little knowledge of
Windows XP, I did what
instinct told me to do.

Selecting menu items in your stack is also not doing much good on Linux,
I'm afraid.

Richmond.

 You can install regular fonts from an installer CD.
 http://www.dartmouth.edu/~introjpn/00_windowsxp.html

 You can show Japanese font in a field. 
 But can not select menu items correctly. 
 --
 Kenji Kojima / 小島健治
 http://www.kenjikojima.com/


 On Jul 28, 2013, at 9:06 AM, Richmond wrote:

 On 07/28/2013 03:14 PM, in...@kenjikojima.com wrote:
 Hi,

 It works on Mac OS, But does not work on Windows.
 go to url 
 http://kenjikojima.com/livecode/download/unicodeMenuStudy.livecode;

 What's wrong?

 Thanks,
 --
 Kenji Kojima / 小島健治
 http://www.kenjikojima.com/
 Sorry; pictures required for this one:

 http://forums.runrev.com/viewtopic.php?f=18t=16173

 Richmond.

 ___
 use-livecode mailing list
 use-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: How can I get Unicode Menu Items on Windows?

2013-07-28 Thread Richmond
I do believe that if all the Japanese characters you use are
within the Unicode area reserved for Hiragana, Katakana and
Kanji it should not be necessary for end-users to have to
perform extra tricks to get your stuff working on their setup.

My, limited, experience with Livecode and Unicode fonts on Windows
has been fairly negative with the exception of XP.

Richmond.

___
use-livecode mailing list
use-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: How can I get Unicode Menu Items on Windows?

2013-07-28 Thread in...@kenjikojima.com
I tested the stack on Windows XP.
It did not work.
--
Kenji Kojima / 小島健治
http://www.kenjikojima.com/


On Jul 28, 2013, at 11:16 AM, Richmond wrote:

 I do believe that if all the Japanese characters you use are
 within the Unicode area reserved for Hiragana, Katakana and
 Kanji it should not be necessary for end-users to have to
 perform extra tricks to get your stuff working on their setup.
 
 My, limited, experience with Livecode and Unicode fonts on Windows
 has been fairly negative with the exception of XP.
 
 Richmond.
 
 ___
 use-livecode mailing list
 use-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: How can I get Unicode Menu Items on Windows?

2013-07-28 Thread Richmond
On 07/28/2013 06:26 PM, in...@kenjikojima.com wrote:
 I tested the stack on Windows XP.
 It did not work.
 --
 Kenji Kojima / 小島健治
 http://www.kenjikojima.com/



Well then, that needs to be filed as a BUG report so that the RunRev
people can sort it out.

Richmond.

___
use-livecode mailing list
use-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: huh? a non-table accepting tabs instead of leaving?

2013-07-28 Thread Dr. Hawkins
On Sat, Jul 27, 2013 at 7:50 PM, Mark Wieder mwie...@ahsoftware.net wrote:

 Saturday, July 27, 2013, 3:21:11 PM, you wrote:

 On one of these, when I tab, it inserts a tab into the next field,
 rather than processing it.

 The tabstops of that field is not empty.

We have a winner.

Now if I can only figure out how it *got* a tabstop.

Hmm, if I put 7tab8 into the field, should that create a tabtop?
-- 
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: How can I get Unicode Menu Items on Windows?

2013-07-28 Thread in...@kenjikojima.com
I will. 
Thanks,
--
Kenji Kojima / 小島健治
http://www.kenjikojima.com/


On Jul 28, 2013, at 11:29 AM, Richmond wrote:

 On 07/28/2013 06:26 PM, in...@kenjikojima.com wrote:
 I tested the stack on Windows XP.
 It did not work.
 --
 Kenji Kojima / 小島健治
 http://www.kenjikojima.com/
 
 
 
 Well then, that needs to be filed as a BUG report so that the RunRev
 people can sort it out.
 
 Richmond.
 
 ___
 use-livecode mailing list
 use-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: How can I get Unicode Menu Items on Windows?

2013-07-28 Thread Richmond
On 07/28/2013 06:37 PM, in...@kenjikojima.com wrote:
 I will. 
 Thanks,
 --
 Kenji Kojima / 小島健治
 http://www.kenjikojima.com/


 On Jul 28, 2013, at 11:29 AM, Richmond wrote:

 On 07/28/2013 06:26 PM, in...@kenjikojima.com wrote:
 I tested the stack on Windows XP.
 It did not work.
 --
 Kenji Kojima / 小島健治
 http://www.kenjikojima.com/


 Well then, that needs to be filed as a BUG report so that the RunRev
 people can sort it out.

 Richmond.



The way Livecode and Unicode DON'T WORK on Windows is a very sore point
that I have been banging on about
for ages with little or no result.

Richmond.

___
use-livecode mailing list
use-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: Finding matched parentheses

2013-07-28 Thread Peter Haworth
Yes, I can believe that. don't think regex is the most efficient thing in
the world.  Some of the tests I did resulted in LC running out of memory
too!  That's another thing I think should work better with matchText and
matchChunk.  Any errors, eg a bad regex, result in a runtime error - would
be much better if they put something into the result.

Pete
lcSQL Software http://www.lcsql.com


On Sun, Jul 28, 2013 at 12:54 AM, Geoff Canyon gcan...@gmail.com wrote:

 I checked, and your solution and my strictTotalMatching function return
 identical results. It took me a while to figure out how it works. It's very
 clever, but interestingly, not very efficient -- it almost certainly
 doesn't matter for the likely use cases, but if you throw a string with a
 few thousand (s and )s at it, seconds will go by before you get the result.

 gc


 On Fri, Jul 26, 2013 at 12:02 PM, dunb...@aol.com wrote:

  I am old fashioned. And late. I think this works:
 
 
 
  on mouseUp
 answer findNests(fld 1)
  end mouseUp
 
 
  function findNests var
 repeat with y = 1 to the number of chars in var
if char y of var = ( then put y  return after lefts --build list
  of left paren
if char y of var = ) then put y  return after rights --build
 list
  of right paren
 end repeat
 put 0  return before rights
 
 repeat with y = the number of lines of lefts down to 1
repeat with u = the number of lines of rights down to 1
   if line y of lefts  line u of rights and line y of lefts  line
  u-1 of rights then
  put line y of lefts  ,  line u of rights  return after
  accum
  delete line y of lefts
  if line u of rights  0 then delete line u of rights
   end if
end repeat
 end repeat
 sort accum numeric
 return accum
  end findNests
 
 
  The returned list orders the char numbers of the paired parens.
 
 
  Craig
 
 
 
  -Original Message-
  From: Peter Haworth p...@lcsql.com
  To: How to use LiveCode use-livecode@lists.runrev.com
  Sent: Fri, Jul 26, 2013 12:09 pm
  Subject: Re: Finding matched parentheses
 
 
  On Fri, Jul 26, 2013 at 12:10 AM, Thierry Douez th.do...@gmail.com
  wrote:
 
   But this one will work and match the first occurence:
  
 if matchChunk(mystring,(\([^)]*\)).*,tstart,tEnd)
  
   Regards,
  
   Thierry
  
 
  Nice Thierry!  Doesn't handle nested parens though, but once again, that
  may not be a possibility in the OP's scenario.
 
  Pete
  lcSQL Software http://www.lcsql.com
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription
  preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Missing APPLY button on IDE

2013-07-28 Thread Camm
I found the simple problem..

In the top far right of script editor page it has an up or down arrow to
hide or not the script editor toolbar !

Must have clicked it by mistake , it stops the red cross as well ?

Regards
Camm

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Richmond
Sent: 28 July 2013 14:45
To: How to use LiveCode
Subject: Re: Missing APPLY button on IDE

On 07/28/2013 04:11 PM, Camm wrote:
 Hi ,

   

 On Windows 7:-

   

 The Apply button is missing on the script editor in IDE ??

 Also errors shown but do not go to script line number ??

   

 Any clues ..

   

 Regards

 Camm



Which version are you using?

I just had a go with LC 6.1.1 rc 1 Community on Windows 7 and had no problem
seeing the 'Apply' button.

Similarly with where the BIG RED X ends up when there is a script error.

How about posting the odd picture to the Forums : 
http://forums.runrev.com/index.php

so we can all see what you mean.

Richmond.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3349 / Virus Database: 3209/6527 - Release Date: 07/28/13

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3349 / Virus Database: 3209/6527 - Release Date: 07/28/13
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3349 / Virus Database: 3209/6527 - Release Date: 07/28/13
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3349 / Virus Database: 3209/6527 - Release Date: 07/28/13


___
use-livecode mailing list
use-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: Finding matched parentheses

2013-07-28 Thread Peter Haworth
On Sun, Jul 28, 2013 at 12:56 AM, Thierry Douez th.do...@gmail.com wrote:

 I
 dropped the idea of using (?R) or its derivatives because for most
 practical cases
 it didn't worked as expected (even crash LC) but
 those regex
 worked in Perl scripts!
  (looks like in php it works great too).


Yes, I saw some of that too when testing some  recursions, also ran into
memory limits.

Pete
lcSQL Software http://www.lcsql.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: Missing APPLY button on IDE

2013-07-28 Thread Richmond

On 07/28/2013 08:59 PM, Camm wrote:

I found the simple problem..

In the top far right of script editor page it has an up or down arrow to
hide or not the script editor toolbar !


Very happy to hear it was easily solved :)



Must have clicked it by mistake , it stops the red cross as well ?

Regards
Camm

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Richmond
Sent: 28 July 2013 14:45
To: How to use LiveCode
Subject: Re: Missing APPLY button on IDE

On 07/28/2013 04:11 PM, Camm wrote:

Hi ,

   


On Windows 7:-

   


The Apply button is missing on the script editor in IDE ??

Also errors shown but do not go to script line number ??

   


Any clues ..

   


Regards

Camm



Which version are you using?

I just had a go with LC 6.1.1 rc 1 Community on Windows 7 and had no problem
seeing the 'Apply' button.

Similarly with where the BIG RED X ends up when there is a script error.

How about posting the odd picture to the Forums :
http://forums.runrev.com/index.php

so we can all see what you mean.

Richmond.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3349 / Virus Database: 3209/6527 - Release Date: 07/28/13

-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3349 / Virus Database: 3209/6527 - Release Date: 07/28/13
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3349 / Virus Database: 3209/6527 - Release Date: 07/28/13
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3349 / Virus Database: 3209/6527 - Release Date: 07/28/13


___
use-livecode mailing list
use-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: Finding matched parentheses

2013-07-28 Thread dunbarx
I will gladly accept being clever and inefficient.


Craig



-Original Message-
From: Peter Haworth p...@lcsql.com
To: How to use LiveCode use-livecode@lists.runrev.com
Sent: Sun, Jul 28, 2013 2:00 pm
Subject: Re: Finding matched parentheses


Yes, I can believe that. don't think regex is the most efficient thing in
the world.  Some of the tests I did resulted in LC running out of memory
too!  That's another thing I think should work better with matchText and
matchChunk.  Any errors, eg a bad regex, result in a runtime error - would
be much better if they put something into the result.

Pete
lcSQL Software http://www.lcsql.com


On Sun, Jul 28, 2013 at 12:54 AM, Geoff Canyon gcan...@gmail.com wrote:

 I checked, and your solution and my strictTotalMatching function return
 identical results. It took me a while to figure out how it works. It's very
 clever, but interestingly, not very efficient -- it almost certainly
 doesn't matter for the likely use cases, but if you throw a string with a
 few thousand (s and )s at it, seconds will go by before you get the result.

 gc


 On Fri, Jul 26, 2013 at 12:02 PM, dunb...@aol.com wrote:

  I am old fashioned. And late. I think this works:
 
 
 
  on mouseUp
 answer findNests(fld 1)
  end mouseUp
 
 
  function findNests var
 repeat with y = 1 to the number of chars in var
if char y of var = ( then put y  return after lefts --build list
  of left paren
if char y of var = ) then put y  return after rights --build
 list
  of right paren
 end repeat
 put 0  return before rights
 
 repeat with y = the number of lines of lefts down to 1
repeat with u = the number of lines of rights down to 1
   if line y of lefts  line u of rights and line y of lefts  line
  u-1 of rights then
  put line y of lefts  ,  line u of rights  return after
  accum
  delete line y of lefts
  if line u of rights  0 then delete line u of rights
   end if
end repeat
 end repeat
 sort accum numeric
 return accum
  end findNests
 
 
  The returned list orders the char numbers of the paired parens.
 
 
  Craig
 
 
 
  -Original Message-
  From: Peter Haworth p...@lcsql.com
  To: How to use LiveCode use-livecode@lists.runrev.com
  Sent: Fri, Jul 26, 2013 12:09 pm
  Subject: Re: Finding matched parentheses
 
 
  On Fri, Jul 26, 2013 at 12:10 AM, Thierry Douez th.do...@gmail.com
  wrote:
 
   But this one will work and match the first occurence:
  
 if matchChunk(mystring,(\([^)]*\)).*,tstart,tEnd)
  
   Regards,
  
   Thierry
  
 
  Nice Thierry!  Doesn't handle nested parens though, but once again, that
  may not be a possibility in the OP's scenario.
 
  Pete
  lcSQL Software http://www.lcsql.com
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription
  preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding matched parentheses

2013-07-28 Thread Thierry Douez
H
​i,​


2013/7/28 Peter Haworth p...@lcsql.com

 Yes, I can believe that. don't think regex is the most efficient thing in
 the world.


​Having using them for years, I still think they are efficient :)​


​But as any tools, you have to use them for the right purpose..
​

Some of the tests I did resulted in LC running out of memory
 too!  That's another thing I think should work better with matchText and
 matchChunk.  Any errors, eg a bad regex, result in a runtime error - would
 be much better if they put something into the result.



​Which has nothing to do with regex but more the way it's implemented in LC.
​



On Sun, Jul 28, 2013 at 12:54 AM, Geoff Canyon gcan...@gmail.com wrote:

 
 ​/snip  - it almost certainly
 ​ ​
 doesn't matter for the likely use cases



​Yes, that's the point.
Considering one knows about regex, it's most of the times faster and
even often easier to write a regex than to code some lines of pure script
language.

​


 but if you throw a string with a
  few thousand (s and )s at it, seconds will go by before you get the
 result


​Who has to deal with such cases ?   :)

​

​Best,

Thierry​




Thierry Douez - http://sunny-tdz.com
Maker of 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: How can I get Unicode Menu Items on Windows?

2013-07-28 Thread in...@kenjikojima.com
This is temporary unicode menu script until bugs are fixed.
go to url http://kenjikojima.com/livecode/download/tempoUnicodeMenu.livecode;

Use menuHistory and custom function getUnicodeMenuItem.
It works on MacOS and WIndows. I do not use Linux. Please try.
--
Kenji Kojima / 小島健治
http://www.kenjikojima.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


[OT] Free Benchmarking Stuff

2013-07-28 Thread Alejandro Tejada
on Fri Jul 26,
Richard Gaskin wrote:

 Does Mark's contribution seem a good start for what you had in mind?

Actually, I could not find RRTest in RevOnline:
http://revonline2.runrev.com/search/tag/developer%20tool/direction/descending/searchtype/latest/

Could you post a direct download link?

Thanks in advance!

Al

___
use-livecode mailing list
use-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: Finding matched parentheses

2013-07-28 Thread David Epstein
Thanks for all the interesting replies to this query.  I used  
offset rather than (what most replies suggested) repeat with (or  
for) each character thinking it would be faster, but that seems to be  
true only if the string is extremely long and the sought for  
character very far from the front.  And I tried to match the first  
( rather than building a list of all matches.  There is no  
practical need for yet another approach, but in case others will find  
it of interest here is a speedy one that does not step through each  
character and barely uses offset.


David Epstein

function offsetPair a,b,str -- NOTE: a and b are single characters,  
str cannot be more than one line
-- in string str, locate the first a, and the nth b, where n = the  
number of a's that precede that b
-- e.g., if a = (  and b = ) the character positions of the first  
matched pair will be returned

-- return 0 if a is not found and empty if no match is found
  put offset(a,str) into ca
  if ca = 0 then return 0
  put numToChar(7) into char 1 to ca of str -- some char that's not  
a or b

  replace a with return in str
  put 1 into na -- number (ordinal) of a's, also the line count in str
  put 0 into nb
  repeat for each line k in str
if k is not empty then -- does this line have (na-nb) instances  
of b?

  get nthHit(na-nb,b,k,z,numToChar(7))
  if it is not empty then return ca  it+ca+length(line 1 to  
na-1 of str)

  add z to nb
end if
add 1 to na
  end repeat
  return empty
end offsetPair

function nthHit n,a,str,@z
  -- returns character number of the nth instance of a (a single  
character) in str

  -- z reports the total number of hits
  put numToChar(7)   str  numToChar(7)  into str   -- so str does  
not begin or end with a

  set itemDelimiter to a
  put -1 + the number of items in str into z
  if n  z then return empty
  return length(item 1 to n of str)
end nthHit

___
use-livecode mailing list
use-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: Finding matched parentheses

2013-07-28 Thread Peter Haworth
On Sun, Jul 28, 2013 at 1:28 PM, Thierry Douez th.do...@gmail.com wrote:

 Having using them for years, I still think they are efficient :)


 But as any tools, you have to use them for the right purpose..


I agree with you on that.


 Some of the tests I did resulted in LC running out of memory
  too!  That's another thing I think should work better with matchText and
  matchChunk.  Any errors, eg a bad regex, result in a runtime error -
 would
  be much better if they put something into the result.
 


 Which has nothing to do with regex but more the way it's implemented in LC.


Yep.  The tests that ran out of memory in LC worked fine in RegExhibit (a
tool I use for testing regex expressions).




Pete
lcSQL Software http://www.lcsql.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


App Template and Icons Pack?

2013-07-28 Thread Magicgate Software - Skip Kimpel
Anybody have any details (screen shots, ect) of what is included with this
product from RunRev?

SKIP
___
use-livecode mailing list
use-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: [OT] Free Benchmarking Stuff

2013-07-28 Thread Mark Wieder
Alejandro-

Sunday, July 28, 2013, 4:53:58 PM, you wrote:

 on Fri Jul 26,
 Richard Gaskin wrote:

 Does Mark's contribution seem a good start for what you had in mind?

 Actually, I could not find RRTest in RevOnline:
 http://revonline2.runrev.com/search/tag/developer%20tool/direction/descending/searchtype/latest/

 Could you post a direct download link?

I can't find it either. In fact, the web interface shows nothing newer
than 9 July. And everything from July is from d...@livecode.com. The
web version of revOnline seems to have very little to do with the IDE
version. I think the design and maintenance of the runrev website has
been taken over by folks who hate LiveCode. It's the only explanation
I can think of.

Use the revOnline interface in the IDE.

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