Re: Creating Array - Auto Numeric

2018-11-21 Thread Sannyasin Brahmanathaswami via use-livecode
On 9/18/18 7:15 AM, Tore Nilsen via use-livecode wrote: You can not put the incrementing numeric key inside an associative array the way you want. The key of any array must be unique, and you can not have several instances of a key in an array. Think of the keys of the array it as the primary

Re: Creating Array - Auto Numeric

2018-09-19 Thread Sannyasin Brahmanathaswami via use-livecode
It my case it was "ignorance about arrays" that may my head hurt. It would nice if the dictionary's "associations" include every keyword related. For example, search on array" One find zero reference to extents But I found them the user guide 1) Chapter on Arrays 2) Section on Processing Text

Re: Creating Array - Auto Numeric

2018-09-19 Thread Bob Sneidar via use-livecode
I was going to say something similar, but thought better of it. Sometimes you need to step back and ask yourself, "What exactly am I trying to do here", or a better question is, "How do I get from where I am to where I want to be (in terms of the data) with the least amount of fuss?" Bob S >

Re: Creating Array - Auto Numeric

2018-09-19 Thread J. Landman Gay via use-livecode
I always forget about "extents". I like concise code, Alex wins. :) -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On September 18, 2018 9:25:02 PM Sannyasin Brahmanathaswami via use-livecode wrote: Well Alex won with "extents"

Re: Creating Array - Auto Numeric

2018-09-18 Thread Sannyasin Brahmanathaswami via use-livecode
Well Alex won with "extents" in fact while he wrote that, I was in the User look at extents.' Jacque does that some thing.. put the number of lines in keys USE CASE Jacque and created a puzzle together, it take quotes of various lengths, creates image tiles of the words. Each tile has a

Re: Creating Array - Auto Numeric

2018-09-18 Thread Richard Gaskin via use-livecode
When solving a problem with a given data structure makes your head hurt, that may be an indication that your head's fine and the problem is with the data structure. :) Can you tell us a bit more about your goal with this? In your example output, if we look at this line:

Re: Creating Array - Auto Numeric

2018-09-18 Thread Alex Tweedly via use-livecode
or,    repeat for each trueword X in tQuote   put (item 2 of the extents of tWordLocationA[X]) + 1 into t1   put tWordLocation into tWordLocationA[X][t1]    end repeat Alex On 18/09/2018 23:57, J. Landman Gay via use-livecode wrote: On 9/18/18 5:01 PM, Sannyasin Brahmanathaswami via

Re: Creating Array - Auto Numeric

2018-09-18 Thread J. Landman Gay via use-livecode
On 9/18/18 5:01 PM, Sannyasin Brahmanathaswami via use-livecode wrote: # how to get "x" to increment? but only by each key in the array? Okay, try this: put fld 1 into tQuote repeat with x = 1 to the number of truewords in tQuote put the number of lines in keys(tWordLocationA[trueword

Re: Creating Array - Auto Numeric

2018-09-18 Thread Tore Nilsen via use-livecode
We are not talking about different things, but the same thing from different angles. I misinterpreted what you wanted to do from your example. What you do manually is creating an associative array with a numeric array as the values for each key in the associative array, which should work

Re: Creating Array - Auto Numeric

2018-09-18 Thread Sannyasin Brahmanathaswami via use-livecode
Tore, must be talking about different things. fld "tQuote" = Cut the apple. Cut the banana. I CAN manually create what we need *on*mouseup *put*"100,320"intoWordLocationsA["Cut"][1] *put*"300,320"intoWordLocationsA["Cut"][2] *put*"200,320"intoWordLocationsA["the"][1] *

Re: Creating Array - Auto Numeric

2018-09-18 Thread J. Landman Gay via use-livecode
On 9/18/18 10:41 AM, Sannyasin Brahmanathaswami via use-livecode wrote: I want to analyse the quote by going through each word. *--* *repeat* withx = 1tothenumberofwordsoffld"_quote" # get the location of the word, put it into variable tWordLocation put tWordLocation to

Re: Creating Array - Auto Numeric

2018-09-18 Thread Sannyasin Brahmanathaswami via use-livecode
On 9/18/18 7:15 AM, Tore Nilsen via use-livecode wrote: > You can not put the incrementing numeric key inside an associative array the > way you want. The key of any array must be unique, and you can not have > several instances of a key in an array. Think of the keys of the array it as > the

Re: Creating Array - Auto Numeric

2018-09-18 Thread Tore Nilsen via use-livecode
You can not put the incrementing numeric key inside an associative array the way you want. The key of any array must be unique, and you can not have several instances of a key in an array. Think of the keys of the array it as the primary keys of a database table. It serves as a unique

Re: Creating Array - Auto Numeric

2018-09-18 Thread Klaus major-k via use-livecode
Hi Craig, > Am 18.09.2018 um 18:47 schrieb dunbarxx via use-livecode > : > > Also, be careful. The string: > "Cut the apple. Cut the banana" > contains only one word. true, but also contains 6 TRUEWORDS! :-) > Craig Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de

Re: Creating Array - Auto Numeric

2018-09-18 Thread dunbarxx via use-livecode
Also, be careful. The string: "Cut the apple. Cut the banana" contains only one word. Craig -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com

Re: Creating Array - Auto Numeric

2018-09-18 Thread dunbarxx via use-livecode
Hi. Is this what you want? on mouseUp repeat with y = 1 to the number of words of fld 1 select word y of fld 1 put the selectedLoc into wordLocationA[y][word y of fld 1] end repeat end mouseUp I suspect not. Is it that you want the output to be: WordLocationA["Cut"][100,320]

Creating Array - Auto Numeric

2018-09-18 Thread Sannyasin Brahmanathaswami via use-livecode
My head always breaks on complex array functions. I can't head around this algorithm Given a "quote" in a field "Cut the apple. Cut the banana" We get to location for each word (that is easy) I want to analyse the quote by going through each word. *--* *repeat* withx =