Hello Both Marks,
Thanks big time. I know I'm on the forum quite a bit (only, however, after hours of fruitless struggling beforehand), but it's still quite humbling each time to receive the help and consideration of strangers who are experts in programming in other parts of the world. On the other hand, there's nothing else like it...
Now to answer some of your questions. I have cut and pasted each of your scripts and tried them more than once to make sure I know exactly what they're doing, and so now I find that I am getting some interesting returns on figures that I wasn't really after but they may prove to be helpful nonetheless, because I hadn't thought about those returns before. For instance, your script now creates a return of the number of keys that are unique to both the text array and the database array.
Here's what I'm actually trying to get a return on:
Let's say you took any book that was in text format. Let's say that book was "Robinson Crusoe." Now let's say you have a database that contains a big list of island words as an example. If the database contained the word "shipwreck" and a match was found in the manuscript, I need to know not only how many unique words from the manuscript matched with words in the database, but also how many times that each of those matchwords occured in the manuscript altogether.
I'm thinking that the problem so far has been that I mistakenly thought it was possible in one line of script to receive a return on all the words found in all the keys of an array. I now think I have to ask for each of those match words by name with brackets to get an actual return of the amount of contents that are found in each key. I'm not exactly sure how to call out those contents or the number of their contents, but I'm thinking it would be something like
Code: Select all
put myTextArray[myWord] after field "matchResults"
and then I could quickly get rid of the delimiters and receive a return on the number of words that were placed in the field "matchResults."
I'm thinking that if I use a return statement with a counter, I could put each of the match words from the intersect into the variable myWord, one at a time, to get the contents out of each key of myTextArray. There's a big possibility that by using your idea to create a copy of the manuscript array before the intersect, I can get the keys out of the copy.
I'll let everyone know as soon as I can give it a try, which will be later in the day.
Oh yeah, there was the question of why I am using this approach. I've only been programming with Revolution for 11 months now (with no prior programming experience), so that probably answers a lot of that question right there. However, I spend more hours programming a week than anyone I know and have built scores of programs, so I've gotten a lot of experience in that limited time. As for this approach for this program, I've been able to successfully accomplish what I'm after in various other ways but they took way too long to get the results (sometimes up to 5 minutes with small manuscripts of less than 3,000 words.) Until I discovered the "intersect" command, it was way too slow to be practical in a big program that does lots of other things.
Anyway, I hope that all sheds some light on the madness of my method. Cheers, deeverd