Re: Find string "xxx" in field yyy OF THIS CARD

2012-02-04 Thread Francis Nugent Dixon

Hi from Beautiful Brittany,

Bob, I kid thee not ! SQL be a mystery to me.
Methinks I miss an element of profound truth.

But, shall it be known, there is so much truth
to imbibe, that infinite truth be at arms length.

... And short are my arms ..

-Francis

Notwithstanding -  Windows is still a pane !

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


Re: Find string "xxx" in field yyy OF THIS CARD

2012-02-03 Thread Bob Sneidar
On the off chance that you are not pulling my leg, SQL is a query language 
intended to work with dissimilar database engines, so that a database driven 
application does not have to depend upon a proprietary database engine. There 
are other advantages, but that is the main one. 

LC provides the ability to connect to several kinds of SQL engines, as well as 
creating and accessing sqLite file based databases on your hard drive. Once you 
get the data into an SQL database (not that difficult) you can use the query 
language to find just about anything about the data. 

In practice there are some differences in the syntax and capabilities of 
different flavors of SQL, but each have resources on the web that can be used 
to glean the proper syntax. I resisted SQL for a long time, and still only use 
it in a fairly rudimentary fashion, but when working with large amounts of 
data, it is a great thing to learn. 

Forgive me if I took the bait and just made a fool of myself. ;-)

Bob


On Feb 3, 2012, at 12:00 PM, Francis Nugent Dixon wrote:

> Hi from BeautifulBrittany,
> 
> Merci André,
> 
> Je n'avait pas pensé à utiliser "DontSearch" !
> 
> J'aime !!
> 
> Bob,
> 
> I hadn't heard this before, and I haven't the faintest
> idea what SQL is. But I will look into it !
> 
> It seems that my knowledge is sadly lacking .
> 
> Thanks !
> 
> -Francis
> 
> "Windows is a pane"
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Find string "xxx" in field yyy OF THIS CARD

2012-02-03 Thread Francis Nugent Dixon

Hi from BeautifulBrittany,

Merci André,

Je n'avait pas pensé à utiliser "DontSearch" !

J'aime !!

Bob,

I hadn't heard this before, and I haven't the faintest
idea what SQL is. But I will look into it !

It seems that my knowledge is sadly lacking .

Thanks !

-Francis

"Windows is a pane"
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Find string "xxx" in field yyy OF THIS CARD

2012-02-03 Thread André Bisseret
Bonjour Francis,

In order to restrict  the find string to a specific card, the following seems 
working :

on mouseUp
local tCardsList,
---
put the cardNames of this stack into tCardsList
repeat for each line tCd in tCardsList
set the dontSearch of tCd to true
end repeat
set the dontSearch of this cd to false -- or of cd n
find string "xxx" -- searching in all fields in the card
end mouseUp 

It is possible to restrict the find to a certain field provided that this field 
is not in a group whose background behavior is true
I mean a field which would have the same name but a different id on each card;
then the following seems possible :

on mouseUp
local tCardsList,
---
put the cardNames of this stack into tCardsList
repeat for each line tCd in tCardsList
set the dontSearch of fld "fldInfo" of tCd to true
end repeat
set the dontSearch of fld "fldInfo" of this cd to false
find string "xxx" in fld "fldInfo"
if the result is "not found" then answer "pas sur cette carte"
end mouseUp

Kenavo from Grenoble

André

Le 2 févr. 2012 à 21:39, Francis Nugent Dixon a écrit :

> Hi from beautiful Brittany,
> 
> Thanks to all for suggestions. I finished up by trying my own
> workaround.
> 
> BUT, I don't know why the syntax "of this card" and
> "of card xx" is accepted in the find command, but doesn't work.
> 
> Would that be a real bug ?
> 
> Secondly, the string I am looking for is in practically
> every record of my stack, and I treat the cards one at
> a time. I'm doing some complex (painful) syntax analysis
> on tons of data in text files, to create a stack of cards.
> 
> So I look for various character strings with a value after them.
> 
> Thirdly, when I have "found" the strings, I use the "foundChunk"
> command to set the strings to "empty" (i.e. remove them completely).
> This aids the continuation of my data analysis. I need this command.
> 
> So I have solved the problem by using the "offset" command, and
> using the result + the length of the offset string to build a
> "findChunk" string "char xx to yy of field zzz" and then I have
> the ammunition to zap the field.
> 
> I had many of these "find string" commands for many different
> values, and wanted the minimum of change to my scripts
> (written over many days) so that my scripts would work.
> 
> Yes ! (Sigh) - I tried solving this with a function, but it had
> so many facets, that I finally resolved the problems inline.
> 
> So I replaced the following multiple instances of commands:
> 
> find string "xxx" in field yyy of this card
> if the result = "not found" then exit mouseUp
> put the foundchunk into SaveChunk
> -- Do stuff with the data
> do "put empty into " & SaveChunk
> 
> with four other commands :
> 
> put offSet("xxx",field yyy) into HoldStart
> if HoldStart = 0 then exit mouseUp
> put the length of "xxx" into HoldStop
> put "char " & HoldStart & " to " & HoldStop & " of field zzz" into 
> SaveChunk
> do "put empty into " & SaveChunk
> 
> Minimum Modification - maximum satisfaction !
> 
> But I'm sure lots of you guys can better my ineficient code !
> 
> -Francis
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Find string "xxx" in field yyy OF THIS CARD

2012-02-02 Thread Bob Sneidar
You have no doubt heard this before, but it sounds like you need to re-engineer 
this using SQL. 

Bob Sneidar
IT Manager
Calvary Chapel CM
Sent from iPhone

On Feb 2, 2012, at 12:39, Francis Nugent Dixon  wrote:

> Hi from beautiful Brittany,
> 
> Thanks to all for suggestions. I finished up by trying my own
> workaround.
> 
> BUT, I don't know why the syntax "of this card" and
> "of card xx" is accepted in the find command, but doesn't work.
> 
> Would that be a real bug ?
> 
> Secondly, the string I am looking for is in practically
> every record of my stack, and I treat the cards one at
> a time. I'm doing some complex (painful) syntax analysis
> on tons of data in text files, to create a stack of cards.
> 
> So I look for various character strings with a value after them.
> 
> Thirdly, when I have "found" the strings, I use the "foundChunk"
> command to set the strings to "empty" (i.e. remove them completely).
> This aids the continuation of my data analysis. I need this command.
> 
> So I have solved the problem by using the "offset" command, and
> using the result + the length of the offset string to build a
> "findChunk" string "char xx to yy of field zzz" and then I have
> the ammunition to zap the field.
> 
> I had many of these "find string" commands for many different
> values, and wanted the minimum of change to my scripts
> (written over many days) so that my scripts would work.
> 
> Yes ! (Sigh) - I tried solving this with a function, but it had
> so many facets, that I finally resolved the problems inline.
> 
> So I replaced the following multiple instances of commands:
> 
> find string "xxx" in field yyy of this card
> if the result = "not found" then exit mouseUp
> put the foundchunk into SaveChunk
> -- Do stuff with the data
> do "put empty into " & SaveChunk
> 
> with four other commands :
> 
> put offSet("xxx",field yyy) into HoldStart
> if HoldStart = 0 then exit mouseUp
> put the length of "xxx" into HoldStop
> put "char " & HoldStart & " to " & HoldStop & " of field zzz" into 
> SaveChunk
> do "put empty into " & SaveChunk
> 
> Minimum Modification - maximum satisfaction !
> 
> But I'm sure lots of you guys can better my ineficient code !
> 
> -Francis
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

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


Re: Find string "xxx" in field yyy OF THIS CARD

2012-02-02 Thread Francis Nugent Dixon

Hi from beautiful Brittany,

Thanks to all for suggestions. I finished up by trying my own
workaround.

BUT, I don't know why the syntax "of this card" and
"of card xx" is accepted in the find command, but doesn't work.

Would that be a real bug ?

Secondly, the string I am looking for is in practically
every record of my stack, and I treat the cards one at
a time. I'm doing some complex (painful) syntax analysis
on tons of data in text files, to create a stack of cards.

So I look for various character strings with a value after them.

Thirdly, when I have "found" the strings, I use the "foundChunk"
command to set the strings to "empty" (i.e. remove them completely).
This aids the continuation of my data analysis. I need this command.

So I have solved the problem by using the "offset" command, and
using the result + the length of the offset string to build a
"findChunk" string "char xx to yy of field zzz" and then I have
the ammunition to zap the field.

I had many of these "find string" commands for many different
values, and wanted the minimum of change to my scripts
(written over many days) so that my scripts would work.

Yes ! (Sigh) - I tried solving this with a function, but it had
so many facets, that I finally resolved the problems inline.

So I replaced the following multiple instances of commands:

 find string "xxx" in field yyy of this card
 if the result = "not found" then exit mouseUp
 put the foundchunk into SaveChunk
 -- Do stuff with the data
 do "put empty into " & SaveChunk

with four other commands :

 put offSet("xxx",field yyy) into HoldStart
 if HoldStart = 0 then exit mouseUp
 put the length of "xxx" into HoldStop
 put "char " & HoldStart & " to " & HoldStop & " of field zzz"  
into SaveChunk

 do "put empty into " & SaveChunk

Minimum Modification - maximum satisfaction !

But I'm sure lots of you guys can better my ineficient code !

-Francis



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


Re: Find string "xxx" in field yyy OF THIS CARD

2012-02-02 Thread dunbarx
Jim.


But LC natively can restrict finds to a single field:


find yourText in fld yourFld


Francis needs to restrict his find to a specific card. I assume there are more 
than one field on that card, and that other cards have fields that may contain 
the text he wants.


I can think of several ways to do this, none of them onerous, just not natively.


Craig



-Original Message-
From: Jim Hurley 
To: use-livecode 
Sent: Thu, Feb 2, 2012 12:28 pm
Subject: Re: Find string "xxx" in field yyy OF THIS CARD


Hi Francis,

I have used this, suggestion by a list member some time ago, to restrict the 
find to a specific field.

You might substitute the card id in place of the field id.

on mouseUP
   put the value of the clickline into tText 
   put the id of field "theText" into tNum
   find empty
   find  string  tText in field id tNum
end mouseUP

Jim


> 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
> 
> -Francis
> 
> After nearly 50 years of dedicated computing, I still
> find that Windows is a pane ..:>)
> 


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

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


Re: Find string "xxx" in field yyy OF THIS CARD

2012-02-02 Thread Peter M. Brigham, MD
On Feb 2, 2012, at 9:30 AM, dunb...@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
pmb...@gmail.com
http://home.comcast.net/~pmbrig


> -----Original Message-----
> From: Francis Nugent Dixon 
> To: use-livecode 
> 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




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


Re: Find string "xxx" in field yyy OF THIS CARD

2012-02-02 Thread Jim Hurley
Hi Francis,

I have used this, suggestion by a list member some time ago, to restrict the 
find to a specific field.

You might substitute the card id in place of the field id.

on mouseUP
   put the value of the clickline into tText 
   put the id of field "theText" into tNum
   find empty
   find  string  tText in field id tNum
end mouseUP

Jim


> 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
> 
> -Francis
> 
> After nearly 50 years of dedicated computing, I still
> find that Windows is a pane ..:>)
> 


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


Re: Find string "xxx" in field yyy OF THIS CARD

2012-02-02 Thread dunbarx
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



-Original Message-
From: Francis Nugent Dixon 
To: use-livecode 
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

-Francis

After nearly 50 years of dedicated computing, I still
find that Windows is a pane ..:>)

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

 

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


Find string "xxx" in field yyy OF THIS CARD

2012-02-02 Thread Francis Nugent Dixon

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

-Francis

After nearly 50 years of dedicated computing, I still
find that Windows is a pane ..:>)

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