Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
put "Paris,proper name"&cr&"paris,conjugated verb" into myStg
get lineOffset("paris",myStg)
put IT
IT returns 1 which is for the proper name. But I search for the conjugated verb.
Even if I write first "set the wholeMatches to true", IT returns 0
Thanks for your help, Jean-Paul.
Last edited by atout66 on Sat Jun 07, 2014 8:01 pm, edited 1 time in total.
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.
The casesensitive ! That's exactly what I was looking for.
@ Craig, no I don't have always the same format but with caseSensitive everything is going much easier;-)
Thanks a lot to both of you.
Kind regards, Jean-Paul.
@Craig: The problem with being as familiar with xtalk as you and I are is that we're spoiled about capitalization. If you add the fact that Macs don't much care about it either, we're doubly cursed. When I get on a Linux server or a mobile device I'm constantly tripped up by that. I think the number of times I've been bitten has terrorized me into compliance.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com