Post
by dunbarx » Sat Jun 07, 2014 6:51 pm
Hi.
Several ways to do this, and an array is the most compact, but if you always have the same format, that is, the conjugated verb is always the second line of each variable instance, then you do not have to be clever, just exploitative:
get lineOffset("paris",myStg) + 1.
You could write a function that either gets the first or second line, depending on which type you needed.
Now this seems almost like cheating, and it is. But there is nothing wrong with that, exceept that it is sort of a balancing act, and not terribly robust, never mind stable and easy to manage.
So my question to you is this. Does each pair of words reside in its own variable, or is there one variable containing a long return delimited list of pairs, noun1/verb1/noun2/verb2, etc.? Write back, and we can find more elegant ways to work this.
Craig Newman