Find string "xxx" in field yyy OF THIS CARD

Peter M. Brigham, MD pmbrig at gmail.com
Thu Feb 2 12:28:57 EST 2012


On Feb 2, 2012, at 9:30 AM, DunbarX at aol.com wrote:

> Francis.
> 
> 
> You are right in that the (my) find hint seems not to work. I think it used to, but now am confused. I will ask to have it removed.
> 
> 
> This is a workaround, so that if your text is not on the card you are at, at least you will not be taken somewhere else. I am sure you could have written this yourself:
> 
> 
> 
> on mouseUp
>   lock screen
>   put the number of this cd into tCard
>   find yourText
>   if the number of this cd <> tCard then
>      put "not found here"
>      go cd tCard
>      end if
> end mouseUp
> 
> 
> It seems that what we really need is either:
> 
> 
> find yourText on cd yourCard --like I thought we had, or
> find yourText on marked cds --something like that
> 
> 
> Craig Newman

Craig's handler will work if you are already on the card you want to find in. More generally, do something like this:

on doMyFind tStr, tFldName, tCardID
   put the short id of this card into startCdID
   lock screen
   go cd id tCardID
   find string tStr in fld tFldName
   if the result = "not found" or the short id of this card <> tCardID then
      go card id startCdID
      beep
      exit doMyFind
   end if
end doMyFind

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


> -----Original Message-----
> From: Francis Nugent Dixon <effendi at wanadoo.fr>
> To: use-livecode <use-livecode at lists.runrev.com>
> Sent: Thu, Feb 2, 2012 8:53 am
> Subject: Find string "xxx" in field yyy OF THIS CARD
> 
> 
> Hi from Beautiful Brittany,
> 
> I have been having problems with the "find" command.
> In a stack with multiple cards, I want to find specific
> strings on a card of my choice (the card currently displayed),
> and NO other.
> 
> If I code "find string xxx in fld yyy of this card" ..
> 
> doesn't work.
> 
> If I look in the dictionary for the "find" command, I find no
> information concerning a search on a specific card.
> However, a user comment (from Craig) shows that we can use :
> 
> find yourtext in field yourfield of card cardOfInterest
> 
> by which I understand that you can define a specific
> card by its number.  This does not work either.
> 
> Has anybody had problems like this, or have I reached
> my first LiveCode "bug" ?
> 
> Is there any way of restricting a "find string" to a
> specific card. I'm on LiveCode Build 1080 Version 4.5.0







More information about the use-livecode mailing list