Re: repeating string

2014-02-12 Thread Bob Sneidar
Something like, put “burger” into the mouth of me with “force”? Or maybe, set the mouth of “bob” to “full” with “burger”? Hmmm… I’m guessing I’m hungry. BRB! Bob On Feb 11, 2014, at 09:51 , Mike Kerner wrote: > I guess I'm more of a fan of having multiple ways of saying something, > because t

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 wrote: > On 2/10/14, 6:15 PM, Alex Tweedly wrote: > > I don't see a

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 [for N times] or put [N copies of] Thus put "hello" into myVar put "xyz" for 2 times after char 3 of myVar--> helxyzxyzlo or perhaps put 2 copies of "

Re: repeating string

2014-02-11 Thread Devin Asay
On Feb 10, 2014, at 5:15 PM, Alex Tweedly wrote: > On 10/02/2014 17:51, Devin Asay wrote: >> Seems like the most LiveCode-like syntax would be something like: >> >> pad with at beginning|end| [for] N >> [times] >> >> So, >> >> pad myvar with space at beginning 4 times >> >> pad fld "foo"

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 with at beginning|end| [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 --> helxyz

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 wrote: > On 2/10/14, 11:51 AM, Devin Asay wrote: > >> Seems like the most LiveCode-like syntax would be something like: >> >> pad with at beginning|end| [for] >> N [times] >> >> So, >> >> pad myvar with space at beginning 4 time

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 with at beginning|end| [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 --> helxy

Re: repeating string

2014-02-10 Thread Devin Asay
On Feb 8, 2014, at 10:41 PM, Geoff Canyon wrote: > On Wed, Feb 5, 2014 at 9:06 AM, Mike Kerner 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: > >

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 wrote: > How about rpt(15,5) ? If you don't quote the "15", the numberformat would > take effect, I gues

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 wrote: > On Wed, Feb 5, 2014 at 9:06 AM, Mike Kerner wrote: > >> put 30 "a" into goop, but that is a recipe for failure, and >> put 30 "a"'s into goop is alm

Re: repeating string

2014-02-08 Thread Geoff Canyon
On Wed, Feb 5, 2014 at 9:06 AM, Mike Kerner 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

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 mill

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

Re: [Bulk] Re: repeating string

2014-02-06 Thread Dave McKee
t 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

Re: [Bulk] Re: repeating string

2014-02-06 Thread Dave McKee
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 mes

Re: repeating string

2014-02-06 Thread Dave Kilroy
hem." - 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-l

Re: repeating string

2014-02-05 Thread Bob Sneidar
using libraries and inserting. Bob On Feb 4, 2014, at 18: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 > > -- > On the first day, God created the heavens and the Eart

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 <

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 functi

Re: repeating string

2014-02-05 Thread Dave Kilroy
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-

Re: repeating string

2014-02-05 Thread Mike Kerner
nice. On Wed, 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 bein

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 wrote: > nice. > > > On Wed, Feb 5, 2014 at 11:24 AM, Alex Tweedly wrote: > >> On 05/02/2014 15:06, Mike Kerner w

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

Re: repeating string

2014-02-05 Thread Mike Kerner
oding, 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.

Re: repeating string

2014-02-05 Thread Dave Kilroy
h 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

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 b

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

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-

Re: repeating string

2014-02-04 Thread dunbarx
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 To: How to use LiveCode Sent: Tue, Feb 4, 2014 10:15 pm Subject: Re: repeating string

Re: repeating string

2014-02-04 Thread Mike Kerner
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 >> >> > _

Re: repeating string

2014-02-04 Thread Mark Schonewille
, 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

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