mark cards by finding -- new insights

Timothy Miller gandalf at
Fri Jul 8 17:11:10 EDT 2005

>On 7/7/05 8:34 PM, Timothy Miller wrote:
>>>I just checked out the possibility that somehow the script 
>>>inserted an invisible character into the variable. The number of 
>>>characters in the variable patientName is as it should be.
>Hm. So the text is okay. You could try setting a breakpoint in the 
>handler and walking through it in the debugger to make sure the 
>command is actually executing. That's about all I can think of. 
>(Although if you've already tried the command from the message box, 
>you already know it executed.) If it works in other stacks but not 
>in this one, then there has to be something different about this 

Hi Jacque, and Marty,

Thank you for your continuing interest in this relatively small "issue."

(Issue is a Klingon word that means "problem." The Klingon term is 
widely employed in Silicon Valley.)

I have investigated further. Your comments are good ones of course, 
though I must admit I had considered those items already.

I actually discovered something interesting. I previously wrote:


Different stack:

>Unmark all cards
>lock messages
>mark cards by finding "Jones, Bob" in bg field  "daily7"
>answer the number of marked cards

Three marked cards.

Same stack:

>put "Jones, Bob" into theVar
>unmark all cards
>lock messages
>mark cards by finding theVar in bg field  "daily7"
>answer the number of marked cards

Three marked cards, again.

I'm pretty sure three is the correct number of hits.


The next step was to try the same thing in the problematic stack. I 
tried that last night. Here's how it went. In the multi-line message 
box, I entered:

>put "Jones, Bob" into theVar
>unmark all cards
>lock messages
>mark cards by finding theVar in field "patient name"
>answer the number of marked cards

The correct number of hits would be 1. The number of marked cards 
came back as 0. I tried it repeatedly, and it failed repeatedly. 
Recall that this same script, in the message box, worked fine in a 
different stack.

When I tried

>put "Jones, Bob" into theVar
>unmark all cards
>lock messages
>mark cards by finding string theVar in field "patient name"
>answer the number of marked cards

The number of marked cards was correct -- 1 card.

The following script, also typed into the msg box, also worked fine:

>put "Jones, Bob" into theVar
>unmark all cards
>lock messages
>find theVar in field "patient name"

Following the deductive chain, I concluded that the original script 
was not the problem, nor was the spelling of the contents of the 
variable, nor the contents of the field.

Just to be sure, I went back to the problem script, got the charToNum 
of each character in the variable and compared it with the charToNum 
of each character in the field. They were identical.

It seemed like the problem must either be a bug, or some property of 
the problem stack, the group (with "behave like a background" turned 
on), or the field.

The problem stack didn't seem to have any unusual properties. Neither 
did the group or the field. "Ignore find command" was not checked in 
any of these objects.

I don't understand all the basic field properties, but I messed 
around with turning "focusable" "lock text" and "auto hilite text" on 
or off. I was doing it somewhat haphazardly, not expecting much to 
happen. At some point, 'mark cards by finding thevar in..." started 
working. I knew I hadn't changed the script, because it remained 
typed in the msg box, unchanged.

I saved and closed the stack, re-opened it. 'mark cards by finding 
theVar in...' stopped working again. This time, messing around with 
the field properties didn't get it working again. I tried all the 
combinations of "on" and "off" I had tried before. I didn't change 
the field properties before or after saving, closing and re-opening 
the stack.

This morning, I tried again. Once again, 'mark cards by finding 
theVar...' didn't work. Zero hits. This time, I remembered the field 
had a script in it. One "on closefield" handler and one "on mouseUp" 
handler. I didn't think these would make a difference because 
messages were locked. Nevertheless, I temporarily commented these 
out. 'Mark cards by finding thevar...' started working correctly.

However, when I un-commented the handlers, the 'mark cards by 
finding...' script continued to work. I saved and closed the stack, 
re-opened it, and the command continued to work. This time, I hadn't 
changed any field properties.

It's hard to avoid the conclusion that this is an intermittent bug 
that is influenced by some combination of field properties and/or 
field scripts and/or the placement of the field in a group, and/or 
group properties, and/or turning on "behave like a background" in the 
group properties. It might be specific to OS X, and it might be 
influenced by the HCaddressing property, which is turned on in my 
case. I'm not thrilled by the prospect of trying to isolate the 
problem any further. The number of possibilities is too large. I 
think I won't.

Gosh, that even bored me! I'm not sure this is of any interest to 
anyone. Maybe somehow, somewhere, it might be mildly useful to 
someone. Hope so.

If it happened to me, it will probably happen to others, at least 
occasionally. I'm not going to submit it to bugzilla, because novices 
shouldn't do that. Someone more qualified might want to submit it on 
my behalf, if he/she is convinced that it's been investigated 

'Mark cards by finding string theVar...' seems to work consistently 
and it suits my needs, so I'll stick with that.



More information about the Use-livecode mailing list