Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / FileMaker Topics / February 2004

Tip: Looking for answers? Try searching our database.

How to write this script (or other solution)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ano - 29 Feb 2004 13:45 GMT
Hi,

I am working with this fp5 file with over 5000 records. Every record has
something like 40 fields.

The db is describing (in great detail) texts in a large number of pages and
chapters from books. Every field can contain texts (multiple hitwords) from
one chapter. If there are 25 chapters, I have also 25 fields filled with
text.

Lets say I need to FIND all records that contain a certain textstring in ANY
field. The textstring can be anything (varies from day to day).

How do I made a script under a button that lets me (after the button is
pushed) quickly enter a certain string by hand and than searches all visible
records
and all fields(!) for the textstring?

Hans
Matt Wills - 29 Feb 2004 15:19 GMT
1. Define a global field (e.g., "Input").

2. Use the Custom Dialog script step to enter the terms you want to search
into the field "Input".

3. Use the Find/Replace script step to search for any occurrence of the
contents of  "Input" across all fields.

Alternately, instead of Custom Dialog, put "Input" on a layout for user
entry, with a button that activates step 3, above.

If you need to look for multiple words in one search, you'll have to parse
"Input" into separate words and do a script that steps through each word.
You could use spaces between individual words as a delimiter, but searching
for a term of multiple words would require some other speciifc delimiter.

Matt

> Hi,
>
[quoted text clipped - 15 lines]
>
> Hans
ano - 29 Feb 2004 19:15 GMT
> 3. Use the Find/Replace script step to search for any occurrence of the
> contents of  "Input" across all fields.

This only finds me one by one each record that has an occurrence. It does
not make a selection of all records to browse. And that is needed....

In my oldfashioned dbf database prog, i could give any string and the prog
did search the whole db (all fields and all records) for that - making a
complete selection. I am sure FMP must be able to do that also?!?!?!

I went to work and made a script that went into "Find" mode and than one by
one enters the desired string into each appropiate field (made a dialog and
an "input" field in which i placed the string - "copy / paste" in each
field - "go to field[next]" - at the end i let it perform the "Find"
command).
But the problem is that i cannot switch from the first request to a next
request automatically. So with a script, i can only fill each field in Find
mode with my textstring IN ONE AND THE SAME REQUEST. So my search is only
positive if my textstring occurs in EACH field.
So i cannot get on with this approach either.... Or is there a scriptstep to
go from one request to the next. I cannot get it to work with "Go to
record/request/page".

Regards
Hans
Marc-Andr? Paiement - 29 Feb 2004 19:32 GMT
> > 3. Use the Find/Replace script step to search for any occurrence of the
> > contents of  "Input" across all fields.
[quoted text clipped - 18 lines]
> go from one request to the next. I cannot get it to work with "Go to
> record/request/page".

Hello,
The script step is New record/request. So your script should look something
like:

enter find mode
set field (field_a) (global imput)
new record/reqest
set field (field_b) (global imput)
new record/reqest
set field (field_c) (global imput)
etc
perform find
go to layout x
view as list

Another way to search different fields at once is to create a caculated
field that concatenates all the differenet fields (something like: field_a &
" " field_b & " " field_c & " " field_d & field_e) and then performs your
finds on this field.  But this is only possible if the total lenght of all
your fields concatenated together doesn't exceed the 64 000 caracters limit.

HTH
Marc-Andr? Paiement

> Regards
> Hans
Marc-Andr? Paiement - 29 Feb 2004 19:37 GMT
> Another way to search different fields at once is to create a caculated
> field that concatenates all the differenet fields (something like: field_a &
> " " field_b & " " field_c & " " field_d & field_e) and then performs your
> finds on this field.  But this is only possible if the total lenght of all
> your fields concatenated together doesn't exceed the 64 000 caracters limit.

Sorry, that should read:
field_a & " " & field_b & " " & field_c & " " & field_d & " " & field_e
ano - 29 Feb 2004 21:11 GMT
> Hello,
> The script step is New record/request. So your script should look something
[quoted text clipped - 10 lines]
> go to layout x
> view as list

Marc,

I tried this one with "new request" (i did not find it at first in the
script-listing).
AND IT WORKS as far as i can see now!!!!!
Many thanks!!!!

Hans
Matt Wills - 29 Feb 2004 20:00 GMT
> > 3. Use the Find/Replace script step to search for any occurrence of the
> > contents of  "Input" across all fields.
>
> This only finds me one by one each record that has an occurrence. It does
> not make a selection of all records to browse. And that is needed....

So now we're back to a standard Find using multiple find requests created by
the script.

You're looking for the occurrence of one word over several fields. For each
field in which the word might appear, make a new find request and paste the
sought value into the appropriate field.

Enter Find mode
Paste Sought Value into Field A
New Record/Request
Paste Sought Value into Field B
New Record/Request
Paste Sought Value into Field C
Perform Find

Don't forget that the field has to be on the layout in order to perform a
find on it.  For this reason, I will create a layout that contains all
fields in my file, switch to that layout to perform the search, then back to
my display layout. You don't even notice it happening. Either that, or put
"invisible" placements of the fields on a layout.

Matt
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.