Find restricted to given card

dunbarx at aol.com dunbarx at aol.com
Sun May 1 16:11:05 EDT 2011


I assumed that you were talking about grouped "backGround" fields that also would have had the same id. In your case, I see, those other fields may have the same name, but will certainly have different id's, so the native find restriction option works.


I don't think there is a native way to do this with bg fields commonly used to hold data across multiple cards. You have to let LC do the work:


on mouseUp
  lock screen
  put the id of this cd into currentCardID
  find yourString in veld nameOfYourField  --can be a name now
  if the id of this cd <> currentCardID then go cd id currentCardID
end mouseUp


Ugly, but works, and simple. You will have to do this if you use "backGround" fields.


Craig Newman




-----Original Message-----
From: James Hurley <jhurley0305 at sbcglobal.net>
To: use-livecode at lists.runrev.com
Sent: Sun, May 1, 2011 12:43 pm
Subject: Re: Find restricted to given card


Thanks John. That is perfect.

I changed the line from:

   Find "jim" in field "theText"

to:

   Find "jim" in field id the id of field "theText"

Too lazy to even look up the number.

Jim



John Dixon Wrote

> Hi Jim...
> 
> Just had a quick test... two cards each with a field...
> 
> on mouseUp
>    find "jim" in field id 1004
> end mouseUp
> 
> Without using the id, it finds 'Jim' in both fields as you are seeing. Using 
the id of the field it only looks in the one field.
> 
> be well

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 




More information about the use-livecode mailing list