Re: I didn't know this...

2014-12-28 Thread Mike Bonner
I too would prefer this way because its the livecode readable way.  While
this particular one is a pretty simple regex-- put
replacetext(tNames,(\bc),x) it would get complicated way too fast
depending on need.  A for each loop would be fine and work fast also, but I
personally wouldn't mind your idea being a feature request.

On Sat, Dec 27, 2014 at 11:44 PM, Geoff Canyon gcan...@gmail.com wrote:

 It's too bad this won't work:

put bob carol ted alice into S
replace c with x in char 1 of each word of S
put S -- puts bob xarol ted alice


 On Sat, Dec 27, 2014 at 5:42 PM, Kay C Lan lan.kc.macm...@gmail.com
 wrote:

  Nice :-)
 
  This isn't limited to variables but for works for fields as well.
 
  Taken the liberty of entering an Enhancement Request - 14311 - that the
  Dictionary entry be amended to include your example and note that replace
  can also be used on chunks within a container, not just the entire
  container.
  ___
  use-livecode mailing list
  use-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: I didn't know this...

2014-12-28 Thread Peter M. Brigham
On Dec 27, 2014, at 1:54 PM, dunb...@aol.com wrote:

 The beauty of xTalk chunking expressions is that they do just this sort of 
 thing. So if you had:
 
 
 ABCDEFG in a field 1, you can just as easily:
 
 
 -- replace D with empty in fld 1
 -- delete char 4 of fld 1

Yeah, that stuff is basic. I do text manipulation up, down, and sideways, but I 
never discovered that replace works on chunks.

-- 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: I didn't know this...

2014-12-28 Thread Peter Haworth
Expanding the use of each would be great!

delete item 2 of each line of tVar, for example

Pete
lcSQL Software
On Dec 27, 2014 10:44 PM, Geoff Canyon gcan...@gmail.com wrote:

 It's too bad this won't work:

put bob carol ted alice into S
replace c with x in char 1 of each word of S
put S -- puts bob xarol ted alice


 On Sat, Dec 27, 2014 at 5:42 PM, Kay C Lan lan.kc.macm...@gmail.com
 wrote:

  Nice :-)
 
  This isn't limited to variables but for works for fields as well.
 
  Taken the liberty of entering an Enhancement Request - 14311 - that the
  Dictionary entry be amended to include your example and note that replace
  can also be used on chunks within a container, not just the entire
  container.
  ___
  use-livecode mailing list
  use-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


I didn't know this...

2014-12-27 Thread Peter M. Brigham
Other people may already know this, but I just discovered that you can do 
something like:

put 12.34.56.78 into p
replace . with empty in char 4 to -1 of p

and sure enough, you get 12.345678

I did not know that the replace command can work on a chunk within a variable. 
The documentation doesn't reflect this.

It only takes small things to make me happy.  :-)

-- 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: I didn't know this...

2014-12-27 Thread dunbarx




-Original Message-
From: Peter M. Brigham pmb...@gmail.com
To: How to use LiveCode use-livecode@lists.runrev.com
Sent: Sat, Dec 27, 2014 12:38 pm
Subject: I didn't know this...


Other people may already know this, but I just discovered that you can do 
something like:

put 12.34.56.78 into p
replace . with empty in char 4 to -1 of p

and sure enough, you get 12.345678

I did not know that the replace command can work on a chunk within a variable. 
The documentation doesn't reflect this.

It only takes small things to make me happy.  :-)

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

 
___
use-livecode mailing list
use-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: I didn't know this...

2014-12-27 Thread dunbarx
Hi,


The beauty of xTalk chunking expressions is that they do just this sort of 
thing. So if you had:


ABCDEFG in a field 1, you can just as easily:


-- replace D with empty in fld 1
-- delete char 4 of fld 1


or:


set the itemDel to D
put item 1 of fld 1  item 2 of fld 1 into fld 1


Using the offset function would work as well, but is qualitatively different 
than chunking.


All depends on how you want to go about it. Thank the parsers. They understand 
how human beings think.


Craig



-Original Message-
From: Peter M. Brigham pmb...@gmail.com
To: How to use LiveCode use-livecode@lists.runrev.com
Sent: Sat, Dec 27, 2014 12:38 pm
Subject: I didn't know this...


Other people may already know this, but I just discovered that you can do 
something like:

put 12.34.56.78 into p
replace . with empty in char 4 to -1 of p

and sure enough, you get 12.345678

I did not know that the replace command can work on a chunk within a variable. 
The documentation doesn't reflect this.

It only takes small things to make me happy.  :-)

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

 
___
use-livecode mailing list
use-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: I didn't know this...

2014-12-27 Thread Kay C Lan
Nice :-)

This isn't limited to variables but for works for fields as well.

Taken the liberty of entering an Enhancement Request - 14311 - that the
Dictionary entry be amended to include your example and note that replace
can also be used on chunks within a container, not just the entire
container.
___
use-livecode mailing list
use-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: I didn't know this...

2014-12-27 Thread Geoff Canyon
It's too bad this won't work:

   put bob carol ted alice into S
   replace c with x in char 1 of each word of S
   put S -- puts bob xarol ted alice


On Sat, Dec 27, 2014 at 5:42 PM, Kay C Lan lan.kc.macm...@gmail.com wrote:

 Nice :-)

 This isn't limited to variables but for works for fields as well.

 Taken the liberty of entering an Enhancement Request - 14311 - that the
 Dictionary entry be amended to include your example and note that replace
 can also be used on chunks within a container, not just the entire
 container.
 ___
 use-livecode mailing list
 use-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