Re: repeating string

2014-02-11 Thread Devin Asay

On Feb 10, 2014, at 5:15 PM, Alex Tweedly a...@tweedly.net
 wrote:

 On 10/02/2014 17:51, Devin Asay wrote:
 Seems like the most LiveCode-like syntax would be something like:
 
 pad container with string at beginning|end|chunk description [for] N 
 [times]
 
 So,
 
 pad myvar with space at beginning 4 times
 
 pad fld foo with 0 at end 10 times
 
 pad hello with xyz after char 3 for 2 times -- helxyzxyzlo
 
 
 While I like the general idea, I don't think that's the *most* LC-like syntax.
 I don't see any need to invent a new verb pad; why not simply something like
 
 put value [for N times] chunk description
 or
 put [N copies of] value chunk description
 
 Thus
   put hello into myVar
   put xyz for 2 times after char 3 of myVar-- helxyzxyzlo
 or perhaps
   put 2 copies of xyz after char 3 of myVar
 
 Or indeed
   put abc  4 copies ofdef into newVar
 to give a value of abcdef


I like your suggestion, Alex. It makes sense to simply add capability to an 
existing command. I wonder whether the open language model will make it easy to 
support syntax enhancements like this?

Devin

Devin Asay
Office of Digital Humanities
Brigham Young University


___
use-livecode mailing list
use-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: repeating string

2014-02-11 Thread J. Landman Gay

On 2/10/14, 6:15 PM, Alex Tweedly wrote:


I don't see any need to invent a new verb pad; why not simply
something like

put value [for N times] chunk description
or
put [N copies of] value chunk description

Thus
put hello into myVar
put xyz for 2 times after char 3 of myVar-- helxyzxyzlo
or perhaps
put 2 copies of xyz after char 3 of myVar

Or indeed
put abc  4 copies ofdef into newVar
to give a value of abcdef


I could go with the first one, but if we're to avoid inventing new 
syntax then I'd drop the version that uses copies. But the first 
variation would work and I like the idea of building off existing 
terminology.


--
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: repeating string

2014-02-11 Thread Mike Kerner
I guess I'm more of a fan of having multiple ways of saying something,
because then each person can use whatever feels most natural and intuitive
to them instead of being forced.


On Tue, Feb 11, 2014 at 12:40 PM, J. Landman Gay
jac...@hyperactivesw.comwrote:

 On 2/10/14, 6:15 PM, Alex Tweedly wrote:

  I don't see any need to invent a new verb pad; why not simply
 something like

 put value [for N times] chunk description
 or
 put [N copies of] value chunk description

 Thus
 put hello into myVar
 put xyz for 2 times after char 3 of myVar-- helxyzxyzlo
 or perhaps
 put 2 copies of xyz after char 3 of myVar

 Or indeed
 put abc  4 copies ofdef into newVar
 to give a value of abcdef


 I could go with the first one, but if we're to avoid inventing new syntax
 then I'd drop the version that uses copies. But the first variation would
 work and I like the idea of building off existing terminology.


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




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-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: repeating string

2014-02-10 Thread Mike Kerner
the BASIC RPT$ syntax is s not LC.  of might work, though.  I
also hate the * syntax.  Yes, I know what it means, but I'm a CS junkie.


On Sun, Feb 9, 2014 at 12:54 AM, Jerry Jensen j...@jhj.com wrote:

 How about rpt(15,5) ? If you don't quote the 15, the numberformat would
 take effect, I guess.

 On Feb 8, 2014, at 9:41 PM, Geoff Canyon gcan...@gmail.com wrote:

  On Wed, Feb 5, 2014 at 9:06 AM, Mike Kerner mikeker...@roadrunner.com
 wrote:
 
  put 30 a into goop, but that is a recipe for failure, and
  put 30 a's into goop is almost unreadable
 
 
  If we're devising syntax, I think some other languages use * as in:
 
  put 30 * a into goop
 
  This still runs into problems because of LC's typeless variables:
 
  put 5 * 15 -- puts 75
  put 5 * 15 -- puts 1515151515
  put 15 into x
  put 5 * 15 -- puts 75
  put 15 into x
  put 5 * 15 -- still puts 75, nor should it change
 
  Perhaps of?
 
  put 5 of 15 -- puts 1515151515
  ___
  use-livecode mailing list
  use-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




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-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: repeating string

2014-02-10 Thread Devin Asay

On Feb 8, 2014, at 10:41 PM, Geoff Canyon gcan...@gmail.com wrote:

 On Wed, Feb 5, 2014 at 9:06 AM, Mike Kerner mikeker...@roadrunner.comwrote:
 
 put 30 a into goop, but that is a recipe for failure, and
 put 30 a's into goop is almost unreadable
 
 
 If we're devising syntax, I think some other languages use * as in:
 
 put 30 * a into goop
 
 This still runs into problems because of LC's typeless variables:
 
 put 5 * 15 -- puts 75
 put 5 * 15 -- puts 1515151515
 put 15 into x
 put 5 * 15 -- puts 75
 put 15 into x
 put 5 * 15 -- still puts 75, nor should it change
 
 Perhaps of?
 
 put 5 of 15 -- puts 1515151515

Seems like the most LiveCode-like syntax would be something like:

pad container with string at beginning|end|chunk description [for] N 
[times]

So,

pad myvar with space at beginning 4 times

pad fld foo with 0 at end 10 times

pad hello with xyz after char 3 for 2 times -- helxyzxyzlo


Devin

Devin Asay
Office of Digital Humanities
Brigham Young University


___
use-livecode mailing list
use-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: repeating string

2014-02-10 Thread J. Landman Gay

On 2/10/14, 11:51 AM, Devin Asay wrote:

Seems like the most LiveCode-like syntax would be something like:

pad container with string at beginning|end|chunk description [for] N 
[times]

So,

pad myvar with space at beginning 4 times

pad fld foo with 0 at end 10 times

pad hello with xyz after char 3 for 2 times -- helxyzxyzlo


Ooh. Nice! Like.

--
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: repeating string

2014-02-10 Thread Mike Kerner
I like that, too


On Mon, Feb 10, 2014 at 12:54 PM, J. Landman Gay
jac...@hyperactivesw.comwrote:

 On 2/10/14, 11:51 AM, Devin Asay wrote:

 Seems like the most LiveCode-like syntax would be something like:

 pad container with string at beginning|end|chunk description [for]
 N [times]

 So,

 pad myvar with space at beginning 4 times

 pad fld foo with 0 at end 10 times

 pad hello with xyz after char 3 for 2 times -- helxyzxyzlo


 Ooh. Nice! Like.

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




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-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: repeating string

2014-02-10 Thread Alex Tweedly

On 10/02/2014 17:51, Devin Asay wrote:

Seems like the most LiveCode-like syntax would be something like:

pad container with string at beginning|end|chunk description [for] N 
[times]

So,

pad myvar with space at beginning 4 times

pad fld foo with 0 at end 10 times

pad hello with xyz after char 3 for 2 times -- helxyzxyzlo


While I like the general idea, I don't think that's the *most* LC-like 
syntax.
I don't see any need to invent a new verb pad; why not simply 
something like


put value [for N times] chunk description
or
put [N copies of] value chunk description

Thus
   put hello into myVar
   put xyz for 2 times after char 3 of myVar-- helxyzxyzlo
or perhaps
   put 2 copies of xyz after char 3 of myVar

Or indeed
   put abc  4 copies ofdef into newVar
to give a value of abcdef

-- 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: repeating string

2014-02-08 Thread Peter M. Brigham
Without using Regex, you can do this:

function makeString tChar, n
   -- returns a string of n characters (tChar)
   -- no repeat loop!
   put cr into line n of m
   replace cr with tChar in m
   return m
end makeString

-- Peter

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

On Feb 5, 2014, at 11:24 AM, Alex Tweedly wrote:

 On 05/02/2014 15:06, Mike Kerner wrote:
 Alex's idea is also clever, but what if I am trying to repeat another
 character, like #?
 
 
 
 put replacetext( format(%30s,  ),  , x) into myVar
 
 (no promises for being the speediest solution - but still one line and no 
 library involved).
 -- 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


___
use-livecode mailing list
use-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: repeating string

2014-02-08 Thread Richard Gaskin

Nice, Peter.

Inspired by that I wondered if we might use the lineDel to some 
advantage here, and it turns out to be ever so slightly faster:


on mouseUp
   put 1 into n
   -- test 1:
   put the millisecs into t
   repeat n
  put MakeString(#, 100) into r1
   end repeat
   put the millisecs - t into t1
   -- test 2:
   put the millisecs into t
   repeat n
  put MakeString2(#, 100) into r2
   end repeat
   put the millisecs - t into t2
   -- display results:
   put t1   t2  (r1=r2)cr r1 len(r1) cr r2  len(r2)
end mouseUp

function makeString tChar, n
   -- returns a string of n characters (tChar)
   -- no repeat loop!
   put cr into line n of m
   replace cr with tChar in m
   return m
end makeString

function makeString2 tChar, n
   set the linedel to tChar
   put tChar into line n of m
   return m
end makeString2


On my slow Mac that produces:

75 70 true
100
100

And if the char you need is either space or null, binaryEncode can 
produce a string of arbitrary length padded with either of those (and a 
whole lot more  - binaryEncode is quite a powerhouse of utility).


--
 Richard Gaskin
 Fourth World Systems
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: repeating string

2014-02-08 Thread Geoff Canyon
On Wed, Feb 5, 2014 at 9:06 AM, Mike Kerner mikeker...@roadrunner.comwrote:

 put 30 a into goop, but that is a recipe for failure, and
 put 30 a's into goop is almost unreadable


If we're devising syntax, I think some other languages use * as in:

put 30 * a into goop

This still runs into problems because of LC's typeless variables:

put 5 * 15 -- puts 75
put 5 * 15 -- puts 1515151515
put 15 into x
put 5 * 15 -- puts 75
put 15 into x
put 5 * 15 -- still puts 75, nor should it change

Perhaps of?

put 5 of 15 -- puts 1515151515
___
use-livecode mailing list
use-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: repeating string

2014-02-08 Thread Jerry Jensen
How about rpt(15,5) ? If you don't quote the 15, the numberformat would take 
effect, I guess.

On Feb 8, 2014, at 9:41 PM, Geoff Canyon gcan...@gmail.com wrote:

 On Wed, Feb 5, 2014 at 9:06 AM, Mike Kerner mikeker...@roadrunner.comwrote:
 
 put 30 a into goop, but that is a recipe for failure, and
 put 30 a's into goop is almost unreadable
 
 
 If we're devising syntax, I think some other languages use * as in:
 
 put 30 * a into goop
 
 This still runs into problems because of LC's typeless variables:
 
 put 5 * 15 -- puts 75
 put 5 * 15 -- puts 1515151515
 put 15 into x
 put 5 * 15 -- puts 75
 put 15 into x
 put 5 * 15 -- still puts 75, nor should it change
 
 Perhaps of?
 
 put 5 of 15 -- puts 1515151515
 ___
 use-livecode mailing list
 use-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: repeating string

2014-02-06 Thread Dave Kilroy
Very nice Bob - I must get into using libraries myself, I'm using a variety
of methods to help me reuse code but they are all a bit kludgy - I think I'm
just about ready to bite the bullet...



-
Some are born coders, some achieve coding, and some have coding thrust upon 
them. - William Shakespeare  Hugh Senior

--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/repeating-string-tp4675472p4675518.html
Sent from the Revolution - User mailing list archive at Nabble.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: [Bulk] Re: repeating string

2014-02-06 Thread Dave McKee
I am fed up with this Piper system. This AM, I couldn't connect at all to the 
working piper, when I launched the ios app I was prompted to run wifi setup and 
to double tap the piper power button before connecting to its wifi, BUT after 
selecting the Piper wifi, it never gets the check mark in my wifi settings, 
meaning that my iPhone 5S can not connect to it.

I have tried powering the Piper off and on but I always end up back with being 
unable to connect to the Piper or reconfigure.

Sorry but this system just does NOT work. If I thought I could get my 
investment back, I'd ask for it. This system is sucking down AC and asside from 
warming up the room, does nothing useful.

Hodie Non Cras

 On Feb 6, 2014, at 5:07 AM, Dave Kilroy d...@applicationinsight.com wrote:
 
 Very nice Bob - I must get into using libraries myself, I'm using a variety
 of methods to help me reuse code but they are all a bit kludgy - I think I'm
 just about ready to bite the bullet...
 
 
 
 -
 Some are born coders, some achieve coding, and some have coding thrust upon 
 them. - William Shakespeare  Hugh Senior
 
 --
 View this message in context: 
 http://runtime-revolution.278305.n4.nabble.com/repeating-string-tp4675472p4675518.html
 Sent from the Revolution - User mailing list archive at Nabble.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: [Bulk] Re: repeating string

2014-02-06 Thread Dave McKee
Please ignore this rant, I managed to respond to the wrong email

Hodie Non Cras

 On Feb 6, 2014, at 5:27 AM, Dave McKee sarawakd...@rogers.com wrote:
 
 I am fed up with this Piper system. This AM, I couldn't connect at all to the 
 working piper, when I launched the ios app I was prompted to run wifi setup 
 and to double tap the piper power button before connecting to its wifi, BUT 
 after selecting the Piper wifi, it never gets the check mark in my wifi 
 settings, meaning that my iPhone 5S can not connect to it.
 
 I have tried powering the Piper off and on but I always end up back with 
 being unable to connect to the Piper or reconfigure.
 
 Sorry but this system just does NOT work. If I thought I could get my 
 investment back, I'd ask for it. This system is sucking down AC and asside 
 from warming up the room, does nothing useful.
 
 Hodie Non Cras
 
 On Feb 6, 2014, at 5:07 AM, Dave Kilroy d...@applicationinsight.com wrote:
 
 Very nice Bob - I must get into using libraries myself, I'm using a variety
 of methods to help me reuse code but they are all a bit kludgy - I think I'm
 just about ready to bite the bullet...
 
 
 
 -
 Some are born coders, some achieve coding, and some have coding thrust upon 
 them. - William Shakespeare  Hugh Senior
 
 --
 View this message in context: 
 http://runtime-revolution.278305.n4.nabble.com/repeating-string-tp4675472p4675518.html
 Sent from the Revolution - User mailing list archive at Nabble.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: repeating string

2014-02-05 Thread Alex Tweedly

How about

put format(%30s,  ) into a

-- Alex.

On 2/5/2014 03:28, Mike Kerner wrote:

There isn't a repeating string function/keyword/construct, right?

put 30 spaces into a or
put space * 30 into a







___
use-livecode mailing list
use-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: repeating string

2014-02-05 Thread Mark Schonewille

Hi Mike,

Into item 29 gives you a string of 29 chars, after 29 makes a string of 
30 chars, into item 30 gives a string of 30 chars.


--
Best regards,

Mark Schonewille

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

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other 
colour spaces. http://www.color-converter.com


Buy my new book Programming LiveCode for the Real Beginner 
http://qery.us/3fi


LiveCode on Facebook:
https://www.facebook.com/groups/runrev/

On 2/5/2014 04:14, Mike Kerner wrote:

blink, blink, pregnant pause/
That's clever.  It would be item 29, but that hardly matters.  What's even
more interesting about that is that
put space into word 29 of mySpaces
  will give me a string that's 1 character long.




___
use-livecode mailing list
use-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: repeating string

2014-02-05 Thread Mike Kerner
Mark,
I must have screwed something up the first time, because I wound up with
31, even though I expected 30.  When I just tested it, it came out at 30.

Alex's idea is also clever, but what if I am trying to repeat another
character, like #?


I was trying to avoid the solution Craig suggested by using a built-in
construct, which made me think that we should have something like

put 30 a into goop, but that is a recipe for failure, and
put 30 a's into goop is almost unreadable


On Wed, Feb 5, 2014 at 4:38 AM, Mark Schonewille 
m.schonewi...@economy-x-talk.com wrote:

 Hi Mike,

 Into item 29 gives you a string of 29 chars, after 29 makes a string of 30
 chars, into item 30 gives a string of 30 chars.


 --
 Best regards,

 Mark Schonewille

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

 Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour
 spaces. http://www.color-converter.com

 Buy my new book Programming LiveCode for the Real Beginner
 http://qery.us/3fi

 LiveCode on Facebook:
 https://www.facebook.com/groups/runrev/

 On 2/5/2014 04:14, Mike Kerner wrote:

 blink, blink, pregnant pause/
 That's clever.  It would be item 29, but that hardly matters.  What's even
 more interesting about that is that
 put space into word 29 of mySpaces
   will give me a string that's 1 character long.



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




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-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: repeating string

2014-02-05 Thread Dave Kilroy
Mike Kerner wrote
 I was trying to avoid the solution Craig suggested 

Why do you want to avoid it? Making a function to do the job seems the best
way to me!



-
Some are born coders, some achieve coding, and some have coding thrust upon 
them. - William Shakespeare  Hugh Senior

--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/repeating-string-tp4675472p4675487.html
Sent from the Revolution - User mailing list archive at Nabble.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: repeating string

2014-02-05 Thread Mike Kerner
because if it's part of the language, and my vocabulary improves, then I
have less crap to move into my libraries, and I would feel a lot less
foolish if I discover such a thing later.  Even worse, when I throw a kluge
into a project, and I can't find it, later, when I need it again, I end up
reinventing the wheel each time, and maybe I remember to use the same
vernacular, and maybe I don't, in which case I end up biffing myself,
sometimes, by using different names in those different projects - synonyms
can suck when the parser isn't insightful.



On Wed, Feb 5, 2014 at 11:00 AM, Dave Kilroy d...@applicationinsight.comwrote:

 Mike Kerner wrote
  I was trying to avoid the solution Craig suggested

 Why do you want to avoid it? Making a function to do the job seems the best
 way to me!



 -
 Some are born coders, some achieve coding, and some have coding thrust
 upon them. - William Shakespeare  Hugh Senior

 --
 View this message in context:
 http://runtime-revolution.278305.n4.nabble.com/repeating-string-tp4675472p4675487.html
 Sent from the Revolution - User mailing list archive at Nabble.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




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-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: repeating string

2014-02-05 Thread Alex Tweedly

On 05/02/2014 15:06, Mike Kerner wrote:

Alex's idea is also clever, but what if I am trying to repeat another
character, like #?




put replacetext( format(%30s,  ),  , x) into myVar

(no promises for being the speediest solution - but still one line and 
no library involved).

-- 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: repeating string

2014-02-05 Thread Mike Kerner
don't get me wrong, I hate it, because it's c and I can't just stare at it
and know that %30s means pad the front with spaces, but nice.


On Wed, Feb 5, 2014 at 12:50 PM, Mike Kerner mikeker...@roadrunner.comwrote:

 nice.


 On Wed, Feb 5, 2014 at 11:24 AM, Alex Tweedly a...@tweedly.net wrote:

 On 05/02/2014 15:06, Mike Kerner wrote:

 Alex's idea is also clever, but what if I am trying to repeat another
 character, like #?



 put replacetext( format(%30s,  ),  , x) into myVar

 (no promises for being the speediest solution - but still one line and no
 library involved).
 -- 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




 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
and did a little diving.
 And God said, This is good.




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-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: repeating string

2014-02-05 Thread Mike Kerner
nice.


On Wed, Feb 5, 2014 at 11:24 AM, Alex Tweedly a...@tweedly.net wrote:

 On 05/02/2014 15:06, Mike Kerner wrote:

 Alex's idea is also clever, but what if I am trying to repeat another
 character, like #?



 put replacetext( format(%30s,  ),  , x) into myVar

 (no promises for being the speediest solution - but still one line and no
 library involved).
 -- 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




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-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: repeating string

2014-02-05 Thread Dave Kilroy
Mike Kerner wrote
 because if it's part of the language, and my vocabulary improves, then I
 have less crap to move into my libraries, and I would feel a lot less
 foolish if I discover such a thing later.  Even worse, when I throw a
 kluge
 into a project, and I can't find it, later, when I need it again, I end up
 reinventing the wheel each time, and maybe I remember to use the same
 vernacular, and maybe I don't, in which case I end up biffing myself,
 sometimes, by using different names in those different projects - synonyms
 can suck when the parser isn't insightful.

Ah yes, I'm also quite good at biffing myself :)



-
Some are born coders, some achieve coding, and some have coding thrust upon 
them. - William Shakespeare  Hugh Senior

--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/repeating-string-tp4675472p4675493.html
Sent from the Revolution - User mailing list archive at Nabble.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: repeating string

2014-02-05 Thread Alex Tweedly
I absolutely agree. I have a function in my personal standard library 
that does (something close to) this, and I would never consider 
replacing that with this C-like code; I wrote C for a living for too 
many years already, thanks.


But as an answer to the request (i.e. native LC, not a function), it's 
the best I can do :-)


-- Alex.

On 05/02/2014 17:51, Mike Kerner wrote:

don't get me wrong, I hate it, because it's c and I can't just stare at it
and know that %30s means pad the front with spaces, but nice.


On Wed, Feb 5, 2014 at 12:50 PM, Mike Kerner mikeker...@roadrunner.comwrote:


nice.


On Wed, Feb 5, 2014 at 11:24 AM, Alex Tweedly a...@tweedly.net wrote:


On 05/02/2014 15:06, Mike Kerner wrote:


Alex's idea is also clever, but what if I am trying to repeat another
character, like #?




put replacetext( format(%30s,  ),  , x) into myVar

(no promises for being the speediest solution - but still one line and no
library involved).
-- 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




--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
and did a little diving.
And God said, This is good.







___
use-livecode mailing list
use-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: repeating string

2014-02-05 Thread Peter Haworth
This would be a useful command in LC.  I'd like to see a strip
leading/trailing command to.  I usually do that with a regExp but like the
solution to this problem, it's not the most readable thing in the world.

Sounds like it might be worth a post to the Open Source forum.

Pete
lcSQL Software http://www.lcsql.com
Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and
SQLiteAdmin http://www.lcsql.com/sqliteadmin.html


On Wed, Feb 5, 2014 at 2:53 PM, Alex Tweedly a...@tweedly.net wrote:

 I absolutely agree. I have a function in my personal standard library
 that does (something close to) this, and I would never consider replacing
 that with this C-like code; I wrote C for a living for too many years
 already, thanks.

 But as an answer to the request (i.e. native LC, not a function), it's the
 best I can do :-)

 -- Alex.

 On 05/02/2014 17:51, Mike Kerner wrote:

 don't get me wrong, I hate it, because it's c and I can't just stare at it
 and know that %30s means pad the front with spaces, but nice.


 On Wed, Feb 5, 2014 at 12:50 PM, Mike Kerner mikeker...@roadrunner.com
 wrote:

  nice.


 On Wed, Feb 5, 2014 at 11:24 AM, Alex Tweedly a...@tweedly.net wrote:

  On 05/02/2014 15:06, Mike Kerner wrote:

  Alex's idea is also clever, but what if I am trying to repeat another
 character, like #?



  put replacetext( format(%30s,  ),  , x) into myVar

 (no promises for being the speediest solution - but still one line and
 no
 library involved).
 -- 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



 --
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
 and did a little diving.
 And God said, This is good.





 ___
 use-livecode mailing list
 use-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: repeating string

2014-02-05 Thread Bob Sneidar
To avoid having to recode yourself, you should get in the habit of building a 
library stack that you insert into the front of every app you are building. 
That way you can have a central library of common reusable code, which is why 
library stacks were meant to do. 

I am working on a Database Setup card (have been for a couple years now) where 
all my database related commands and functions go. I keep the code in a button 
on the same card, so that by simply going to the card, the script of that 
button gets inserted into the front by the openCard handler. 

That means I can copy/paste the card into any stack I want, and on openStack 
all I have to do is GO to the Database Setup card, and everything else happens 
automagically, including using registering my sqlYoga stuff, checking to see if 
the connection is viable, making the connection, editing the connection etc. 
Very handy using libraries and inserting. 

Bob


On Feb 4, 2014, at 18:28 , Mike Kerner mikeker...@roadrunner.com wrote:

 There isn't a repeating string function/keyword/construct, right?
 
 put 30 spaces into a or
 put space * 30 into a
 
 -- 
 On the first day, God created the heavens and the Earth
 On the second day, God created the oceans.
 On the third day, God put the animals on hold for a few hours,
   and did a little diving.
 And God said, This is good.
 ___
 use-livecode mailing list
 use-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


repeating string

2014-02-04 Thread Mike Kerner
There isn't a repeating string function/keyword/construct, right?

put 30 spaces into a or
put space * 30 into a

-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-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: repeating string

2014-02-04 Thread Mark Schonewille

Mike,

set the itemDel to space
put space into item 30 of mySpaces

--
Best regards,

Mark Schonewille

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

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other 
colour spaces. http://www.color-converter.com


Buy my new book Programming LiveCode for the Real Beginner 
http://qery.us/3fi


LiveCode on Facebook:
https://www.facebook.com/groups/runrev/

On 2/5/2014 03:28, Mike Kerner wrote:

There isn't a repeating string function/keyword/construct, right?

put 30 spaces into a or
put space * 30 into a



___
use-livecode mailing list
use-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: repeating string

2014-02-04 Thread Mike Kerner
blink, blink, pregnant pause/
That's clever.  It would be item 29, but that hardly matters.  What's even
more interesting about that is that
put space into word 29 of mySpaces
 will give me a string that's 1 character long.


On Tue, Feb 4, 2014 at 9:39 PM, Mark Schonewille 
m.schonewi...@economy-x-talk.com wrote:

 Mike,

 set the itemDel to space
 put space into item 30 of mySpaces

 --
 Best regards,

 Mark Schonewille

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

 Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour
 spaces. http://www.color-converter.com

 Buy my new book Programming LiveCode for the Real Beginner
 http://qery.us/3fi

 LiveCode on Facebook:
 https://www.facebook.com/groups/runrev/


 On 2/5/2014 03:28, Mike Kerner wrote:

 There isn't a repeating string function/keyword/construct, right?

 put 30 spaces into a or
 put space * 30 into a


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




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-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: repeating string

2014-02-04 Thread dunbarx
Mark's offering was cute alright, but would be hard to implement the way i 
think you wanted, (pseudoCode)


put (X repeat 5) after char 3 of ABCDE to yield ABCXDE


You could always make a function like:


put dupChar(X,5) after char 3 of yourArgument



function dupChar tChar,dupValue
  repeat dupValue
  put tChar after temp
  end repeat
  return temp
end dupChar


But I bet you knew all this.


Craig Newman




-Original Message-
From: Mike Kerner mikeker...@roadrunner.com
To: How to use LiveCode use-livecode@lists.runrev.com
Sent: Tue, Feb 4, 2014 10:15 pm
Subject: Re: repeating string


blink, blink, pregnant pause/
That's clever.  It would be item 29, but that hardly matters.  What's even
more interesting about that is that
put space into word 29 of mySpaces
 will give me a string that's 1 character long.


On Tue, Feb 4, 2014 at 9:39 PM, Mark Schonewille 
m.schonewi...@economy-x-talk.com wrote:

 Mike,

 set the itemDel to space
 put space into item 30 of mySpaces

 --
 Best regards,

 Mark Schonewille

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

 Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour
 spaces. http://www.color-converter.com

 Buy my new book Programming LiveCode for the Real Beginner
 http://qery.us/3fi

 LiveCode on Facebook:
 https://www.facebook.com/groups/runrev/


 On 2/5/2014 03:28, Mike Kerner wrote:

 There isn't a repeating string function/keyword/construct, right?

 put 30 spaces into a or
 put space * 30 into a


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




-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, This is good.
___
use-livecode mailing list
use-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