Re: Repeat syntax addition

2015-04-07 Thread Peter Haworth
I'm really liking this feature. I just used it in a series of nested repeat statements that traverse their way through an array with 5 levels of keys by writing a function for each level of key. Makes the code so much more readable. Pete lcSQL Software Home of lcStackBrows

Re: Repeat syntax addition

2015-04-07 Thread Ben Rubinstein
(Going back to HyperCard?) the concepts used to be containers and "sources of value" - where the latter can be a literal, a function call, an expression... I always thought that containers were a subset of sources of value, defined as the items where you could set the value as well as get it; b

Re: Repeat syntax addition

2015-04-06 Thread Peter Haworth
I gave up trying to add dictionary notes a while ago since it never worked, not sure what the current status is. I guess there's a completely new dictionary in LC8 but for now, I have my own plugin that gives me the ability to add my own notes to any dictionary entry. Pete lcSQL Software

Re: Repeat syntax addition

2015-04-06 Thread Sri
//runtime-revolution.278305.n4.nabble.com/Repeat-syntax-addition-tp4690850p4690880.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 subscrib

Re: Repeat syntax addition

2015-04-05 Thread Mike Bonner
Use of the word "Container" is a bit deceptive. Perhaps "datasource" would be better. Is it still possible to add notes to the dictionary? On Sun, Apr 5, 2015 at 5:11 PM, Peter Haworth wrote: > I'd guess the last of the options. > > The more I think about this, the more I think there should be

Re: Repeat syntax addition

2015-04-05 Thread Peter Haworth
I'd guess the last of the options. The more I think about this, the more I think there should be mention of this in the dictionary entry for repeat. It's a little like the ability to use a function to create a sortkey in the sort command. Nothing in the dictionary about that except for a user no

Re: Repeat syntax addition

2015-04-05 Thread Mike Bonner
Yeah, kinda makes sense that it would work that way. Grab the data from the container once, do magic things behind the scenes to get it ready to go, then loop through the lines. I guess it could work either way though, where it uses byte offsets to get the next chunk, which would have made the fun

Re: Repeat syntax addition

2015-04-05 Thread Jerry Jensen
Hi Mike, > On Apr 5, 2015, at 12:31 PM, Mike Bonner wrote: > > While not exactly whats been requested, this works pretty well: > >repeat for each line tLine in (myFilter(sData,"abc*","with")) > > I like the way a where clause reads as in the OP, but being able to use an > inline function f

Re: Repeat syntax addition

2015-04-05 Thread Mike Bonner
Actually, if the container is on the receiving end rather than the source end, it wouldn't work. But other than that, yeah. (obviously you can't "put" something into a function) There may be other exceptions I haven't though of. On Sun, Apr 5, 2015 at 2:41 PM, Mike Bonner wrote: > Most likely

Re: Repeat syntax addition

2015-04-05 Thread Mike Bonner
Most likely yeah. I wouldn't swear 100% (I like to TRY first lol) but it SHOULD work. On Sun, Apr 5, 2015 at 2:40 PM, Peter Haworth wrote: > Wow, didn't know that, thanks. > > The dictionary doesn't give any clue that's possible, just uses "container" > as what follows "in". Does that mean tha

Re: Repeat syntax addition

2015-04-05 Thread Peter Haworth
Wow, didn't know that, thanks. The dictionary doesn't give any clue that's possible, just uses "container" as what follows "in". Does that mean that anywhere the dictionary uses the word container, it can be a function call? Pete lcSQL Software Home of lcStackBrowser

Re: Repeat syntax addition

2015-04-05 Thread Mike Bonner
As long as you wrap your function in parens so that it forces evaluation first, then yeah. Have the function do your filter, and then return the filtered data. (not positive you even need the extra parens, but its a habit for me in cases like this.) repeat for each doesn't really care where the

Re: Repeat syntax addition

2015-04-05 Thread Peter Haworth
Hi Mike, I like that. Are you saying you can do that now? Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin On Sun, Apr 5, 2015 at 12:31 PM, Mike Bonner wrote: > While not exactly

Re: Repeat syntax addition

2015-04-05 Thread Peter Haworth
Nic Ralph. Useful where you don;t want to incur the overhead of repeat with but still need a counter. Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin On Sun, Apr 5, 2015 at 12:03 P

Re: Repeat syntax addition

2015-04-05 Thread Mike Bonner
While not exactly whats been requested, this works pretty well: repeat for each line tLine in (myFilter(sData,"abc*","with")) I like the way a where clause reads as in the OP, but being able to use an inline function for data generation is rather powerful, and if all you need is a filter, set

RE: Repeat syntax addition

2015-04-05 Thread Ralph DiMola
Wouldn't it be nice if you could: Repeat for each line tLine in tLines index tIndex End repeat Where tIndex goes from 1 to (in this case) the number of lines in tLines. With such an elegant repeat loop in LC it kills me to do a: Local tIndex put 1 into tIndex Repeat for each line tLine in tLine

Re: Repeat syntax addition

2015-04-05 Thread Peter Haworth
Because I might not want to eliminate the lines beginning with "xyz" from the list, just not process them within the repeat loop, there's a difference. Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin

Re: Repeat syntax addition

2015-04-05 Thread Paul Dupuis
On 4/5/2015 12:54 PM, Peter Haworth wrote: > Wouldn't it be nice if you could: > > repeat for each line rLine in tLines where rLine begins with "xyz" > . > end repeat > > I know it's trivial to test the condition within the repeat loop but having > "where" " seems more elegant somehow. Why not: f

Re: Repeat syntax addition

2015-04-05 Thread Richmond
On 05/04/15 19:54, Peter Haworth wrote: Wouldn't it be nice if you could: repeat for each line rLine in tLines where rLine begins with "xyz" . end repeat I know it's trivial to test the condition within the repeat loop but having "where" " seems more elegant somehow. Pete Certainly seems a

Repeat syntax addition

2015-04-05 Thread Peter Haworth
Wouldn't it be nice if you could: repeat for each line rLine in tLines where rLine begins with "xyz" . end repeat I know it's trivial to test the condition within the repeat loop but having "where" " seems more elegant somehow. Pete lcSQL Software Home of lcStackBrowser