mark cards by finding -- a problem
Timothy Miller
gandalf at doctorTimothyMiller.com
Thu Jul 7 16:06:19 EDT 2005
Hi, my name is Tim. I am a hair-ripper. I haven't ripped for, uh,
three minutes.
I'm stuck on this one. It's probably an obvious mistake but I've
checked, triple checked, etc.
find patientName in field "patient name" works fine. It finds the one
record I expect it to find
if I comment out that line and replace it with --
mark cards by finding patientName in bg field "patient name"
-- no cards get marked.
Oops. I just made it work. Feel free to jump to end of message.
The in between part of the message might be a dull cautionary tale for newbies.
It's possible this is a bug. If it's already well-known, or fixed in
2.6, well, I feel stupid. I suppose there's an easy way to look up
well-known bugs in various versions. Anybody want to tell me how?
I got as far as http://support.runrev.com/bugzilla/#searching and
then "1. Click the "query existing bug reports and enhancement
requests" link." Where the heck is the link?
FWIW, here's the middle part: *****************************
I've checked the syntax. It looks okay. variable patientName contains
what it is supposed to contain. It has to, or the plain "find"
command wouldn't have worked.
I've copied and pasted the variable name and the field name from the
line that works to the line that doesn't work, just to make sure
there were no misspellings or anything. No help.
I tried adding
go to card 1 of bg "record", so the script wouldn't try examining
field "patient name" on card where it didn't exist. No help.
On a lark, I tried
mark cards where patientName = value(bg field "patient name")
On another lark, I tried mark cards by finding value(patientName) in
bg field "patient name"
On a third lark I tried
mark cards by finding "Jones, Bob" in bg field "patient name"
None of the larks helped.
I went back and tried
find patientName in field "patient name" again.
It works fine, just like before.
************************ End of middle part
Here's how I got it to work:
mark cards by finding string patientName in bg field "patient name"
-- does work!
This seems like a good example of the woeful state of the documentation.
The documentation doesn't say that I can write "by finding string
patientName". It doesn't say that it's a good idea to write the "mark
cards by finding" command that way.
I looked at the documentation again. It seems like "find normal"
would have worked anyway. In fact, "find normal" does work for these
fields and variables. Further investigation shows that "find string"
and "find whole" also work.
variable patientname and bg field "patient name" are exact matches in
this case.
Hmmm... I tried --
mark cards by finding whole patientName in bg field "patient name"
-- This doesn't work. It should, as far as I can tell.
I dunno, maybe it's a bug. But every time I think I've found a bug,
it turns out I'm doing something wrong.
Comments welcome
Thank you for your kind concern.
Tim
More information about the use-livecode
mailing list