Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

faulty script fixed and improved

Featured Replies

i initially posted a faulty script of mine here:

faulyt script

all the help i got before took me through extra steps and having to make new fields, which wasn't what i was looking for so i sat down racked my brain and found my own answer: a script to do a "search" for two or more possible values in a single field:

go to record/request/page [first]

loop

if [table::feild = X xor table::field = Y]

go to record/request/page [next;exit after last]

else

omit record

go to record/request/page [first]

end if

end loop

thats it what do you guys think?

  • Author

now how come the script worked in my practice data base but as soon as i put it in the one i'm working on it stops working....nothing like a good foot in your mouth to haly progress for the day

*edit*

heh over reacted a simple misplaced underscore

Edited by Guest

thats it what do you guys think?

Whats wrong with:?

Enter Find Mode

Set Field[table::field; X]

New Record/Request

Set Field[table::field; Y]

Perform Find

A record in which the field contains both X and Y would be found by the two find requests method but not by the xor method

Maybe I misundertstood the inital post. If I had a Table with a field named Fruit.

Record 1 Fruit = Apple

Record 2 Fruit = Apple ¶ Orange

Record 3 Fruit = Orange

The original poster is looking for a way to find records 1 & 3 but not record 2? In which case:

Enter Find Mode

Set Field[table::field; "==" & X]

New Record/Request

Set Field[table::field; "==" & Y]

Perform Find

SlimJim refered to a case where a text field may CONTAIN "apple" or "orange" or both. Which is easily solved by:

Enter Find Mode

Set Field [ table::text ; "apple" ]

New Record/Request

Set Field [ table::text ; "orange" ]

New Record/Request

Set Field [ table::text ; "apple orange" ]

Omit Record

Perform Find

I did some minimal testing on this with, to me at any rate, a surprising result.

Suppose we have six records with the following contents in a text field

Apple

Apple Orange

Apple Pear

Pear Orange

Apple

Orange

The script method choses records 1,5 and 6, which I thought was surprising. The "xor" seems to apply an exact match in the Apple, Orange and if you replace it with an "or" it produces the same result - records 1,5 and 6. If you replace it with "and" you get no results (and an endless loop). Similarly if you replace it with "and not" you just get the two records with Apple.

The finds behave pretty much as expected.

The first sbg2 find finds all the records

The second sbg2 find finds records 1,5 and 6

The Comment find finds records 1, 3 ,4 ,5, 6.

Conclusion. It would appear that If(field="Apple") only returns true if field exactly equals "Apple" whereas the find field = "Apple" returns true if Apple is contained in the field. (I guess the find is on the index of the field)

A default find finds WORDS that start with specific characters. There is no "=" in a default find.

New Record/Request

Set Field [ table::text ; "apple orange" ]

Omit Record

Perform Find

Huh? I completely missed the Omit Record step when reading your reply. Never realized this worked to constrain a found set, glad you posted that.

  • Author

you guys all kinda missed the point

in one field you could have values a,b,c,x,y,z

but i only wanted to find records that in that field had x or y

In your original post you used the xor operator. Which led us to believe you wanted to find records that in that field had x or y - but not both. That is what my find does.

If you want to find records that in that field have either x or y, including both, use sbg2's method.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.