Why is charIndex only for fields?
Posted: Fri Oct 17, 2014 7:57 pm
Hi,
I am creating a program that makes use of the charIndex function. I looked in the dictionary and was surprised to find that the charIndex function only applies to fields. This means I cannot say: answer the charIndex of the last word of "LiveCode Forums", but I can create a field called "text" with "LiveCode Forums" as its contents, and say: answer the charIndex of the last word of field "text". Is there a reason that charIndex cannot be used with strings and variables? (This would make my program quicker as currently it copies text from a variable into a field just to use the charIndex, and does this with 1000+ pieces of text.)
Thanks,
Andrew
I am creating a program that makes use of the charIndex function. I looked in the dictionary and was surprised to find that the charIndex function only applies to fields. This means I cannot say: answer the charIndex of the last word of "LiveCode Forums", but I can create a field called "text" with "LiveCode Forums" as its contents, and say: answer the charIndex of the last word of field "text". Is there a reason that charIndex cannot be used with strings and variables? (This would make my program quicker as currently it copies text from a variable into a field just to use the charIndex, and does this with 1000+ pieces of text.)
Thanks,
Andrew