Re: common code patterns

2017-08-15 Thread Sannyasin Brahmanathaswami via use-livecode
Yes On 8/10/17, 2:42 PM, "use-livecode on behalf of Monte Goulding via use-livecode" wrote: local s command set p put p into s end set function get return s end get

Re: String delimiters [WAS Re: common code patterns]

2017-08-14 Thread Bob Sneidar via use-livecode
I'm at a loss here. What do you mean by multi-line strings besides strings with multiple lines in them? Isn't this already possible?? Bob S > On Aug 14, 2017, at 09:00 , Mark Wieder via use-livecode > wrote: > > On 08/14/2017 03:28 AM, Alex Tweedly via

Re: String delimiters [WAS Re: common code patterns]

2017-08-14 Thread Monte Goulding via use-livecode
> On 15 Aug 2017, at 7:33 am, Monte Goulding via use-livecode > wrote: > > put “foo\ > bar” > > would put: > > foo > bar I had a little play while munching my muesli this morning with adding this to my (probably won’t get in the engine) PR for escaped

Re: String delimiters [WAS Re: common code patterns]

2017-08-14 Thread Monte Goulding via use-livecode
> On 15 Aug 2017, at 5:22 am, Alex Tweedly via use-livecode > wrote: > > put {{ > That's better! > A really readable and short > version that I can deal with. > }} into temp It’s really unlikely we would use { } because one day we will want to implement array

Re: common code patterns

2017-08-14 Thread Monte Goulding via use-livecode
> On 15 Aug 2017, at 2:10 am, Richard Gaskin via use-livecode > wrote: > > But maybe not enough markdown to change how the human eye works. :) Sure, my preferable end goal does not include backticks but I’ll take anything if it’s the only way I can have a

Re: String delimiters [WAS Re: common code patterns]

2017-08-14 Thread Alex Tweedly via use-livecode
If you mean, do I think put \ "This is part of" & \ "A multi-line string which" & \ "I find much less readable." into temp is less preferable than put {{ That's better! A really readable and short version that I can deal with. }} into temp then, Yes - absolutely. To be honest, I don't much

Re: String delimiters [WAS Re: common code patterns]

2017-08-14 Thread Richard Gaskin via use-livecode
Bob Hall wrote: >> On Aug 14, 2017, at 6:28 AM, Alex Tweedly wrote: >> >> While we (i.e. you) are thinking about string delimiters, could we >> PLEASE have some decent way to do multi-line strings. > > I find myself in many situations where multi-line strings would make > my code so much more

Re: String delimiters [WAS Re: common code patterns]

2017-08-14 Thread Bob Hall via use-livecode
> On Aug 14, 2017, at 6:28 AM, Alex Tweedly via use-livecode > wrote: > > While we (i.e. you) are thinking about string delimiters, could we PLEASE > have some decent way to do multi-line strings. I find myself in many situations where multi-line strings would

Re: String delimiters [WAS Re: common code patterns]

2017-08-14 Thread Mike Kerner via use-livecode
So you don't like & ? On Mon, Aug 14, 2017 at 12:00 PM, Mark Wieder via use-livecode < use-livecode@lists.runrev.com> wrote: > On 08/14/2017 03:28 AM, Alex Tweedly via use-livecode wrote: > >> While we (i.e. you) are thinking about string delimiters, could we PLEASE >> have some decent way to do

Re: common code patterns

2017-08-14 Thread Richard Gaskin via use-livecode
Monte Goulding wrote: >> On 14 Aug 2017, at 5:45 pm, Mark Waddingham wrote: >> >> P.S. There is another quote-like char which could be used for >> an implicitly merged / escaped string literal - back-quote - >> `...`. So that should be considered too - one option would be >> single-quote and

Re: common code patterns

2017-08-14 Thread Mark Wieder via use-livecode
On 08/14/2017 02:35 AM, Mark Waddingham via use-livecode wrote: slight 'yak-shave' here with regards constants (http://quality.livecode.com/show_bug.cgi?id=19413) - as anything after an initializer is currently treated as a literal, and *not* an expression. ...and not just 19413. This

Re: String delimiters [WAS Re: common code patterns]

2017-08-14 Thread Mark Wieder via use-livecode
On 08/14/2017 03:28 AM, Alex Tweedly via use-livecode wrote: While we (i.e. you) are thinking about string delimiters, could we PLEASE have some decent way to do multi-line strings. Yes, please. Whether it's like Python's triple-quote No, please. -- Mark Wieder ahsoftw...@gmail.com

Re: common code patterns

2017-08-14 Thread Bob Sneidar via use-livecode
put "Hello there, Teddy Roughrider Roosevelt!" into tText replace "Roughrider" with quote & "Roughrider" & quote in tText Bob S > On Aug 12, 2017, at 13:20 , Richard Gaskin via use-livecode > wrote: > > The q function is handy, but handier still would be to

String delimiters [WAS Re: common code patterns]

2017-08-14 Thread Alex Tweedly via use-livecode
While we (i.e. you) are thinking about string delimiters, could we PLEASE have some decent way to do multi-line strings. Whether it's like Python's triple-quote, or Perl's heredoc, or just some way to do them without either escaped '\n's or non-embedded CRs. Thanks Alex. On

Re: common code patterns

2017-08-14 Thread Mark Waddingham via use-livecode
On 2017-08-14 11:14, Monte Goulding via use-livecode wrote: Hmm… so say merge(“ string “, resolve escapes) = ` string ` ? I’ve got to say I wasn’t thinking of interpolation as I thought that merge does that sufficiently well. Seeing 'special tokens' as syntactic sugar is definitely the way to

Re: common code patterns

2017-08-14 Thread Monte Goulding via use-livecode
> The point here is that if we *were* to use back-tick then it would be worth > considering making it escape capable *and* interpolate capable - i.e. there > would be more going on. It would certainly solve one part of the balancing > act in terms of what people may want to use ' and "

Re: common code patterns

2017-08-14 Thread Mark Waddingham via use-livecode
On 2017-08-14 10:38, Monte Goulding via use-livecode wrote: Oh, please not backtick! The character is awkward to type (its one of the ones that moves around a lot on keyboard layouts) and difficult to read (and always makes me think something more is going on - e.g. as in bash scripts!).

Re: common code patterns

2017-08-14 Thread Monte Goulding via use-livecode
> On 14 Aug 2017, at 5:45 pm, Mark Waddingham via use-livecode > wrote: > > P.S. There is another quote-like char which could be used for an implicitly > merged / escaped string literal - back-quote - `...`. So that should be > considered too - one option would

Re: common code patterns

2017-08-14 Thread Mark Waddingham via use-livecode
On 2017-08-13 23:26, Monte Goulding via use-livecode wrote: Ha “(and may not be)” should really be “(and is really really unlikely to be)” but still it was an interesting thing to have a play with. In its current form - yes - it is unlikely. There are several (some orthogonal, some not)

Re: common code patterns

2017-08-13 Thread Monte Goulding via use-livecode
> On 14 Aug 2017, at 6:50 am, Mark Wieder via use-livecode > wrote: > > I realize it's not reviewed/accepted yet (and may not be), but Monte's done > something impressive here: > > https://github.com/livecode/livecode/pull/5781#issuecomment-322065901 >

Re: common code patterns

2017-08-13 Thread Mark Wieder via use-livecode
On 08/12/2017 01:20 PM, Richard Gaskin via use-livecode wrote: The q function is handy, but handier still would be to have JavaScript's support for interchangeable single- and double-quotes to allow nesting, e.g.: put 'Hello there, Teddy "Roughrider" Roosevelt!' I realize it's not

Re: common code patterns

2017-08-12 Thread Sannyasin Brahmanathaswami via use-livecode
Monte, you request is a bit opaque to me.. but FWIW -- to stay away from globals -- to break up logical "areas of work/services" into separate scripts -- to be able trace back to the original script I find myself doing a lot more of this: I find myself doing a lot of this; behavior_Listen

Re: common code patterns

2017-08-12 Thread Mark Wieder via use-livecode
On 08/12/2017 01:20 PM, Richard Gaskin via use-livecode wrote: The q function is handy, but handier still would be to have JavaScript's support for interchangeable single- and double-quotes to allow nesting, e.g.: put 'Hello there, Teddy "Roughrider" Roosevelt!'

Re: common code patterns

2017-08-12 Thread Richard Gaskin via use-livecode
Dan Friedman wrote: > Here’s my silly contribution. How many times do we write something > like this: > > put “Are you sure you want to delete the image” && quote & myImageName > & quote && “?” into tPrompt > > I have a simple q() function in all my projects: > > function q inData > return

Re: common code patterns

2017-08-11 Thread Dan Friedman via use-livecode
Here’s my silly contribution. How many times do we write something like this: put “Are you sure you want to delete the image” && quote & myImageName & quote && “?” into tPrompt I have a simple q() function in all my projects: function q inData return (quote & inData & quote) end q Now, I

Re: common code patterns

2017-08-11 Thread dunbarx via use-livecode
The subThread about Switch/Case is a current thread on the forum: Craig -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/common-code-patterns-tp4718218p4718394.html Sent from the Revolution - User mailing

Re: common code patterns

2017-08-11 Thread Alex Tweedly via use-livecode
On 11/08/2017 23:17, Monte Goulding via use-livecode wrote: On 11 Aug 2017, at 9:40 am, Alex Tweedly via use-livecode wrote: repeat with i=1 to paramcount()-1 put param(i)&"," after theValue end repeat put param(paramcount()) after theValue

Re: common code patterns

2017-08-11 Thread Mark Wieder via use-livecode
On 08/11/2017 03:21 PM, Monte Goulding via use-livecode wrote: Ha… I hadn’t considered that you might want the elements sorted instead of the keys but of course you might… well I’m not sure I just know I’d really like to have a way to iterate sorted keys and elements… I'm not trying by any

RE: common code patterns

2017-08-11 Thread Ralph DiMola via use-livecode
How to use LiveCode Cc: Dr. Hawkins Subject: Re: common code patterns On Fri, Aug 11, 2017 at 3:08 PM, Mark Wieder via use-livecode < use-livecode@lists.runrev.com> wrote: > On 08/11/2017 02:59 PM, Mike Kerner via use-livecode wrote: > >> That is not easier to read. >> > >

Re: common code patterns

2017-08-11 Thread Dr. Hawkins via use-livecode
On Fri, Aug 11, 2017 at 3:08 PM, Mark Wieder via use-livecode < use-livecode@lists.runrev.com> wrote: > On 08/11/2017 02:59 PM, Mike Kerner via use-livecode wrote: > >> That is not easier to read. >> > > Heh. Mike beat me to it. . . . After seven chalkboards of deprivation, the calculus

Re: common code patterns

2017-08-11 Thread Monte Goulding via use-livecode
> On 12 Aug 2017, at 8:06 am, Mark Wieder via use-livecode > wrote: > >> I guess we could have more explicit syntax here which might be more flexible >> too >> repeat for each element tElement and key tKey in tArray ordered numeric >> ascending > > I must be

Re: common code patterns

2017-08-11 Thread Monte Goulding via use-livecode
> On 11 Aug 2017, at 9:40 am, Alex Tweedly via use-livecode > wrote: > > repeat with i=1 to paramcount()-1 >put param(i)&"," after theValue > end repeat > put param(paramcount()) after theValue > > Shorter, faster, and just plain tidier :-) Hmm…

Re: common code patterns

2017-08-11 Thread Mark Wieder via use-livecode
On 08/11/2017 02:59 PM, Mike Kerner via use-livecode wrote: That is not easier to read. Heh. Mike beat me to it. -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe,

Re: common code patterns

2017-08-11 Thread Mark Wieder via use-livecode
On 08/11/2017 02:46 PM, Monte Goulding via use-livecode wrote: I guess we could have more explicit syntax here which might be more flexible too repeat for each element tElement and key tKey in tArray ordered numeric ascending I must be channeling Mark Waddingham here... I'm worried that the

Re: common code patterns

2017-08-11 Thread Mike Kerner via use-livecode
That is not easier to read. On Fri, Aug 11, 2017 at 5:46 PM, Monte Goulding via use-livecode < use-livecode@lists.runrev.com> wrote: > > > On 12 Aug 2017, at 1:37 am, Mark Waddingham via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > > So, let me rephrase - what are the use-cases

Re: common code patterns

2017-08-11 Thread Monte Goulding via use-livecode
> On 12 Aug 2017, at 1:37 am, Mark Waddingham via use-livecode > wrote: > > So, let me rephrase - what are the use-cases people can see for allowing > (some variant of): > > repeat ... with counter tCounter starting from tStart Hmm…. what about: repeat for

Re: common code patterns

2017-08-11 Thread Mark Wieder via use-livecode
On 08/11/2017 08:42 AM, Alex Tweedly via use-livecode wrote: Is it really worth doing this by changing each of the lines ? Is it not easier, clearer and very likely just as fast, to do: put empty into tNewBreaks repeat for each line tBreak in tBreaks put item 1 of tBreak into tID put the

Re: common code patterns

2017-08-11 Thread Malte Pfaff-Brill via use-livecode
HI Alex, > put param(1) into isLeft > put param(2) into isTop > etc. > > This always has fewer lines (i.e. the same number of lines as the > "recombine" part), and removes the loop completely. > But would change the way the functions are intended to be able to called. myFunction(the loc of

Re: common code patterns

2017-08-11 Thread Alex Tweedly via use-livecode
On 11/08/2017 16:26, Mark Wieder via use-livecode wrote: case 2: iterating through a cr-separated list and needing to modify lines (note: this is even more extreme if I need to delete lines): put tBreaks into tNewBreaks put 1 into tLine repeat for each line tBreak in tBreaks put item 1 of

Re: common code patterns

2017-08-11 Thread Mark Waddingham via use-livecode
On 2017-08-11 17:26, Mark Wieder via use-livecode wrote: On 08/11/2017 02:24 AM, Mark Waddingham via use-livecode wrote: Not quite on topic for the thread, but this interested in me in terms of - what are the use cases? Somewhat similar to Ralph's use cases, this paradigm comes up quite

Re: common code patterns

2017-08-11 Thread Mark Wieder via use-livecode
On 08/11/2017 02:24 AM, Mark Waddingham via use-livecode wrote: Not quite on topic for the thread, but this interested in me in terms of - what are the use cases? Somewhat similar to Ralph's use cases, this paradigm comes up quite often in my code. Probably the most common case is where I

RE: common code patterns

2017-08-11 Thread Ralph DiMola via use-livecode
- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Mark Waddingham via use-livecode Sent: Friday, August 11, 2017 5:25 AM To: How to use LiveCode Cc: Mark Waddingham Subject: RE: common code patterns On 2017-08-10 19:38, Ralph DiMola via use-livecode wrote: > To m

RE: common code patterns

2017-08-11 Thread Mark Waddingham via use-livecode
On 2017-08-10 19:38, Ralph DiMola via use-livecode wrote: To make this even more flexible: repeat for each line tLine in tLines with [counter] tIndex [start] [{1}|x] [step] [{1}|y] end repeat Not quite on topic for the thread, but this interested in me in terms of - what are the use

Re: common code patterns

2017-08-11 Thread J. Landman Gay via use-livecode
On 8/10/17 3:39 PM, Monte Goulding via use-livecode wrote: Jacque the break thing is possible but not what I’m after at the moment. Could you open an enhancement request and I’ll try and get that done for you. Done: http://quality.livecode.com/show_bug.cgi?id=20258 -- Jacqueline Landman Gay

Re: common code patterns

2017-08-11 Thread Thierry Douez via use-livecode
2017-08-11 9:07 GMT+02:00 J. Landman Gay: On 8/10/17 7:42 PM, Monte Goulding: > > Over on the Parent of Target thread we are discussing local var access so >> I wonder if this is a useful common pattern: >> >> local s >> >> command set p >> put p into s >> end set >> >> function get >>

Re: common code patterns

2017-08-11 Thread J. Landman Gay via use-livecode
On 8/10/17 7:42 PM, Monte Goulding via use-livecode wrote: Over on the Parent of Target thread we are discussing local var access so I wonder if this is a useful common pattern: local s command set p put p into s end set function get return s end get Yes, I use that a lot. --

Re: common code patterns

2017-08-11 Thread Terry Judd via use-livecode
Even better - the mobile commands could an error rather than spitting the dummy when called from a non-mobile environment. I usually add my own mobile get and set handlers/functions that do the environment test and then pass the necessary parameter to either mobileControlGet or

Re: common code patterns

2017-08-10 Thread Monte Goulding via use-livecode
> On 11 Aug 2017, at 2:54 pm, Scott Morrow via use-livecode > wrote: > > What about the use of mobile-only commands… needing to always wrap them in > something to keep the IDE from touching. > > if "mobile" is in the environment then > mobileControlSet

Re: common code patterns

2017-08-10 Thread Scott Morrow via use-livecode
What about the use of mobile-only commands… needing to always wrap them in something to keep the IDE from touching. if "mobile" is in the environment then mobileControlSet tObject, tProp, tValue end if > On Aug 10, 2017, at 6:50 PM, Monte Goulding via use-livecode >

Re: common code patterns

2017-08-10 Thread Mark Wieder via use-livecode
On 08/10/2017 06:50 PM, Monte Goulding via use-livecode wrote: A library of common is probably the best description at the moment but the use case is not reusable handlers as we have other means for that. Hmmm... very mysterious. So I take it an array of constants doesn't fit the category.

Re: common code patterns

2017-08-10 Thread Monte Goulding via use-livecode
> On 11 Aug 2017, at 11:45 am, Mark Wieder via use-livecode > wrote: > > You know, if you'd post what you're trying to do it might be more possible to > stay on target here. For instance, I regularly have to fill an array with > constants in an initialization

Re: common code patterns

2017-08-10 Thread Mark Wieder via use-livecode
On 08/10/2017 01:39 PM, Monte Goulding via use-livecode wrote: Sorry folks I should have been more specific and said using existing syntax. You know, if you'd post what you're trying to do it might be more possible to stay on target here. For instance, I regularly have to fill an array with

Re: common code patterns

2017-08-10 Thread Monte Goulding via use-livecode
> On 11 Aug 2017, at 10:53 am, Devin Asay via use-livecode > wrote: > > I’d like to see one like this for conditional structures: > > if then > -- do if true > else > -- do if false > end if > > I always try to use the “full” form of if-then-else. It solves

Re: common code patterns

2017-08-10 Thread Devin Asay via use-livecode
I’d like to see one like this for conditional structures: if then -- do if true else -- do if false end if I always try to use the “full” form of if-then-else. It solves lots of confusion when you end up with nested if-thens. I teach my students to do it this way as best practice, and I

Re: common code patterns

2017-08-10 Thread Monte Goulding via use-livecode
Over on the Parent of Target thread we are discussing local var access so I wonder if this is a useful common pattern: local s command set p put p into s end set function get return s end get Cheers Monte ___ use-livecode mailing list

Re: common code patterns

2017-08-10 Thread Alex Tweedly via use-livecode
Sticking with that style, why not do repeat with i=1 to paramcount()-1 put param(i)&"," after theValue end repeat put param(paramcount()) after theValue Shorter, faster, and just plain tidier :-) or, to change style, is there a reason not to do put param(1) into isLeft put

Re: common code patterns

2017-08-10 Thread Dr. Hawkins via use-livecode
On Thu, Aug 10, 2017 at 11:12 AM, Jerry Jensen via use-livecode < use-livecode@lists.runrev.com> wrote: > Switch constructs without breaks are almost like having a 21st century > “goto”. You can really make a mess if you try. While doing the code for my dissertation, I actually found that I

Re: common code patterns

2017-08-10 Thread Richard Gaskin via use-livecode
Monte Goulding wrote: On 11 Aug 2017, at 7:02 am, Richard Gaskin via use-livecode wrote: Except that's wrong. :) I tend to use 0 as the initial value, and increment at the top of the loop: local tIndex put 0 into tIndex repeat for each line tLine in tLines add 1 to tIndex —

Re: common code patterns

2017-08-10 Thread Monte Goulding via use-livecode
> On 11 Aug 2017, at 7:15 am, Mike Kerner via use-livecode > wrote: > > So back to my original question, and my original comment - you're talking > about macros? See my first reply. However they are used the patterns will be the same ;-) Cheers Monte

Re: common code patterns

2017-08-10 Thread Monte Goulding via use-livecode
> On 11 Aug 2017, at 7:02 am, Richard Gaskin via use-livecode > wrote: > > Except that's wrong. :) > > I tend to use 0 as the initial value, and increment at the top of the loop: > > local tIndex > put 0 into tIndex > repeat for each line tLine in tLines >

Re: common code patterns

2017-08-10 Thread Mike Kerner via use-livecode
So back to my original question, and my original comment - you're talking about macros? See my first reply. On Thu, Aug 10, 2017 at 5:02 PM, Richard Gaskin via use-livecode < use-livecode@lists.runrev.com> wrote: > Monte Goulding wrote: > > Sorry folks I should have been more specific and said

Re: common code patterns

2017-08-10 Thread Richard Gaskin via use-livecode
Monte Goulding wrote: > Sorry folks I should have been more specific and said using existing > syntax. So the original thing posted is what I’m after at the moment: > > local tIndex > put 1 into tIndex > repeat for each line tLine in tLines >— code >add 1 to tIndex > end repeat Except

Re: common code patterns

2017-08-10 Thread Monte Goulding via use-livecode
> On 11 Aug 2017, at 6:20 am, Mark Wieder via use-livecode > wrote: > > On 08/10/2017 10:38 AM, Ralph DiMola via use-livecode wrote: >> To make this even more flexible: >> repeat for each line tLine in tLines with [counter] tIndex [start] [{1}|x] >> [step]

Re: common code patterns

2017-08-10 Thread Mark Wieder via use-livecode
On 08/10/2017 10:38 AM, Ralph DiMola via use-livecode wrote: To make this even more flexible: repeat for each line tLine in tLines with [counter] tIndex [start] [{1}|x] [step] [{1}|y] end repeat I would change the syntax slightly: repeat for each line tLine in tLines [using tIndex [start

Re: common code patterns

2017-08-10 Thread Malte Pfaff-Brill via use-livecode
Hi Monte, What I do way too often is combining all parameters of a function in a string and then split them up again as needed e.g.: repeat with i=1 to paramcount() if i

Re: common code patterns

2017-08-10 Thread Mark Wieder via use-livecode
On 08/10/2017 10:56 AM, Ralph DiMola via use-livecode wrote: Using a break in every case is 95%+ of my switch usage. Also the editor should not do this if there is a case in the immediately preceding non-blank/non-comment line. Doing this and J's suggestion would save me lots of typing.

Re: common code patterns

2017-08-10 Thread Mike Kerner via use-livecode
ick on ralph, and how about if we just get rid of case/switch, and tell everyone to use if/else if/else/end if On Thu, Aug 10, 2017 at 2:28 PM, Richard Gaskin via use-livecode < use-livecode@lists.runrev.com> wrote: > FWIW I'm with Jacque on this one. Not only are exclusive blocks far more >

Re: common code patterns

2017-08-10 Thread Richard Gaskin via use-livecode
FWIW I'm with Jacque on this one. Not only are exclusive blocks far more common in practice, they're also explicit - you can see the work "BREAK" right at the end of the case block. If a template doesn't include that explicit guidance, I fear for the experience of new users confused by how

Re: common code patterns

2017-08-10 Thread Jerry Jensen via use-livecode
Switch constructs without breaks are almost like having a 21st century “goto”. You can really make a mess if you try. > On Aug 10, 2017, at 10:57 AM, J. Landman Gay via use-livecode > wrote: > > On the other hand, it would prevent the common (mostly newbie?)

RE: common code patterns

2017-08-10 Thread Ralph DiMola via use-livecode
...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Bob Sneidar via use-livecode Sent: Thursday, August 10, 2017 1:38 PM To: How to use LiveCode Cc: Bob Sneidar Subject: Re: common code patterns Ooooh... Ah, but then someone

Re: common code patterns

2017-08-10 Thread J. Landman Gay via use-livecode
On the other hand, it would prevent the common (mostly newbie?) mistake where you forget to break and the switch statements run amok. I reported a bug back in the MetaCard days and was gently reminded that I was an idio... um... in error. -- Jacqueline Landman Gay |

Re: common code patterns

2017-08-10 Thread Devin Asay via use-livecode
On Aug 10, 2017, at 11:30 AM, J. Landman Gay via use-livecode > wrote: How about every time I write a "case" statement inside a switch construct, the editor adds a blank line and then "break”? +2! Yes please. Devin Devin

RE: common code patterns

2017-08-10 Thread Ralph DiMola via use-livecode
. Landman Gay Subject: Re: common code patterns How about every time I write a "case" statement inside a switch construct, the editor adds a blank line and then "break"? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software

RE: common code patterns

2017-08-10 Thread Ralph DiMola via use-livecode
...@lists.runrev.com] On Behalf Of Devin Asay via use-livecode Sent: Thursday, August 10, 2017 12:33 PM To: How to use LiveCode Cc: Devin Asay Subject: Re: common code patterns On Aug 10, 2017, at 10:25 AM, Ralph DiMola via use-livecode <use-livecode@lists.runrev.com<mailto:use-li

Re: common code patterns

2017-08-10 Thread Bob Sneidar via use-livecode
Ooooh... Ah, but then someone will complain about occassionally having to delete the break. Bob S > On Aug 10, 2017, at 10:30 , J. Landman Gay via use-livecode > wrote: > > How about every time I write a "case" statement inside a switch construct, > the

Re: common code patterns

2017-08-10 Thread J. Landman Gay via use-livecode
How about every time I write a "case" statement inside a switch construct, the editor adds a blank line and then "break"? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On August 10, 2017 5:03:25 AM Monte

Re: common code patterns

2017-08-10 Thread Devin Asay via use-livecode
On Aug 10, 2017, at 10:25 AM, Ralph DiMola via use-livecode > wrote: Monte, I find that I do this quite often local tIndex put 1 into tIndex repeat for each line tLine in tLines add 1 to tIndex end repeat What would be very

RE: common code patterns

2017-08-10 Thread Ralph DiMola via use-livecode
Monte, I find that I do this quite often local tIndex put 1 into tIndex repeat for each line tLine in tLines add 1 to tIndex end repeat What would be very help full is the construct: repeat for each line tLine in tLines index tIndex end repeat This eliminates 3 lines. Ralph DiMola IT

Re: common code patterns

2017-08-10 Thread Paul Dupuis via use-livecode
On 8/10/2017 6:01 AM, Monte Goulding via use-livecode wrote: > Hi Folks > > I’m looking for a few common code patterns that you find yourselves writing > often but aren’t well suited to reusable handlers. So snippets of code or > common ways that events are handled together in a script for a

Re: common code patterns

2017-08-10 Thread Mike Kerner via use-livecode
Do I sense macros? I have several things that I frequently end up typing that aren't vanilla: for any structure - repeat/if/case/etc., I normally want the "end" to have a comment matching the beginning if i=2 then something end if #i=2 I also frequently use code blocks that I want to label