Jump to content
The ORIGINAL FileMaker Community - Forum - Online Business Apps & Software Forum
Sign in to follow this  
mikey123

Testing for Checkbox set choices

Recommended Posts

mikey123

This should be simple but I'm lost... again.

 

I'm trying to write a script that will test if any (one or several) of 4 words are in a global text field formatted as check boxes that call a value list with these 4 values "Alpha", "Bravo", "Charlie", "Delta".

 

If none of the words is ticked, my script calls for a beep. If one or several of the words are checked then it calls other scripts depending upon the word(s) that are ticked.

 

The scripts are :

myAlphaScript

myBravoScript

myCharlieScript

myDeltaScript

 

I want the scripts to run successively (in any order) if more than one word is found.

 

This script works if "Alpha" is the only checkbox ticked:

 

if[myFile::myField ="Alpha"

perform script [myAlphaScript]

end if

 

Then I continue with:

 

if[myFile::myField ="Bravo"

perform script [myBravoScript]

end if

 

which also works if Bravo is the only word that's ticked.

 

But these don't work if more than one word's checkbox is ticked. I guess because my script expects myField to EQUAL "Alpha" (or whatever) when what I really want is for myAlphaScript to run if myField CONTAINS "Alpha, then to run myBravoScript if that is also ticked, etc etc.

 

There is something very obvious here that I must be overlooking, but what?

Share this post


Link to post
Share on other sites
Jack Rodgers

instead of

 

myfield = "Bravo"

 

use

 

patterncount ( myfield ; "Bravo") > 0

 

Some folks think you can leave out the > 0...

 

Note this will also be true if "BravoGravy" or some other similar word is in the list so make the words unique.

Share this post


Link to post
Share on other sites
AHunter3
Note this will also be true if "BravoGravy" or some other similar word is in the list so make the words unique.

 

And if that IS a risk, use this modified formula:

 

PatternCount ("¶" & myfield & "¶"; "¶" & "Bravo" & "¶")>0

 

 

That will not register "BravoGravy" as a match.

Share this post


Link to post
Share on other sites
David Head

Or even better, use:

 

not IsEmpty ( FilterValues ( myfield ; "bravo" ) )

 

The FilterValues function is specifically designed to work with value lists.

Share this post


Link to post
Share on other sites
mikey123

You guys have all the answers.

 

I've got a few Filemaker books like the "Bible" and "Missing Manual" etc but finding an answer to what is a simple and common question isn't easy. And Googling a few logical keywords isn't any better than the books.

 

Testing for a word in a field has got to be somethiung a lot of people would want to do and there are plenty of other common problems people must have.

 

One of you should write a book referencing the really useful functions and other aspects of Filemaker. I'd be the first to buy it!

Share this post


Link to post
Share on other sites
CobaltSky
...finding an answer to what is a simple and common question isn't easy.

 

I don't know about that. The vast majority of simple and common questions are answered in one or more of the following seven places:

 

1) The 82 page electronic Tutorial document that ships free with every copy of FileMaker

2) The 216 page electronic Users Guide document that ships free with every copy of FileMaker

3) The 60 page Development Guide that ships free with every copy of FileMaker

4) The Online Help that is installed by default with every copy of FileMaker

5) The 210 page Function Reference that is a free download from filemaker.com

6) The 147 page Script Steps Reference that is a free download from filemaker.com

7) The free FileMaker Knowledge Base that is online at filemaker.com.

 

One of you should write a book referencing the really useful functions and other aspects of Filemaker. I'd be the first to buy it!

 

If you have a copy of FileMaker (and/or a web connection) you already have free access to all seven of the above resources.

 

FWIW, in writing the FMP Bible, I was conscious of avoiding too much repetition of material that all FileMaker users already have, in favor of using the page-space to extend the available pool of information -- rather than repackaging (and selling you) another version of the answers to simple and common questions that you have in your possession already. The book does, however, refer the reader to these and other resources. smiley-wink

Share this post


Link to post
Share on other sites
Jack Rodgers
You guys have all the answers.

....

One of you should write a book referencing the really useful functions and other aspects of Filemaker. I'd be the first to buy it!

 

You might check Filemaker's Help file and instruction book...

Share this post


Link to post
Share on other sites
Josh Ormond
FWIW, in writing the FMP Bible, I was conscious of avoiding too much repetition of material that all FileMaker users already have, in favor of using the page-space to extend the available pool of information -- rather than repackaging (and selling you) another version of the answers to simple and common questions that you have in your possession already. The book does, however, refer the reader to these and other resources. smiley-wink

 

And what a fine job you did Ray!!! Love your books.

 

Mikey123 - I think the biggest problems for new developers is the lack of experience. Kind of ironic isn't it? But when you say write a book about the "really" useful features, it's like asking a Librarian to write down a brief synopsis of all the "really" good books she has read over the years.

 

  1. It has the potential of being the size of War and Peace, with literally thousands of editorials.
  2. What is good to one reader, may not be so good for another.

 

Ray and others have kind of done what you are looking for. But the benefit of those books only comes from understanding how each feature works, and spending some time testing them out. And of course, you have to read them. And then again, there really is no way for Ray or any writer to write down all the little nuances of their decades of experience.

 

As for the various Functions...there are 357 pages worth of "really" good functions/scripts available in the reference that FM gives you with your purchase. Spend some time reading over some of the various functions...obviously don't read it cover to cover, but look at a couple each day and you will probably find yourself referencing back to something you read when you encounter a strange problem that you need to solve. And play around with them in a test db. It is amazing what neat things you find these functions are capable of.

Share this post


Link to post
Share on other sites
mikey123

I understand what you're all saying and I think I should have put it differently. All the info is there in the books and manuals I have. But that's a lot of reading and a lot of it isn't yet of use to me while some of it never will be. There must be vital basics that everyone needs all the time.

 

Filemaker helps me run my little business but I'll never be a developer. I wouldn't have the time at any rate and developer is whole other profession.

 

The Bible and other books are great and I consult them all the time but a lot of it is extraneous for the rank beginner like me.

 

Filemaker is so vast and I can't even imagine why someone would need some of the functions, but I do find myself needing ones that only a week ago didn't mean anything to me. But I usually discover them by accident.

 

So the trick is not knowing everything but knowing what are the subjects that you really need to know about. (Crikey I sound like Rumsfeld!)

 

Let me put it this way. I am a journalist, photographer and publisher. I use apps like Photoshop and Indesign every day and I use Macs and advanced digital SLRs every day too.

 

Some Photoshop manuals are pretty good in starting people off with the basics without confusing them with stuff they don't need right away. The program is endless in its possibilities, but when you're starting out it's best to get a grip on the basic techniques, tips and tricks which everyone needs. That's only 5% of the program. The rest you learn later if and when you need it.

 

When a friend asks me where to start in photography I think I know the essential tips and techniques he'll need to do the basics. He won't be a wizard right away and he'll discover the advanced stuff later. He might even get by forever with the initial basics if that's good enough for his needs.

 

Scot Kelby does this very well in some of his Photoshop books.

 

In most things, the trick is knowing what to ignore when you're just starting. Even an old Cessna 172 cockpit looks pretty daunting to a beginner with all those buttons and dials but once you know the 3 essential buttons and the 3 essential dials, most people could fly a simple circuit by ignoring the rest of the instrumentation. But you'd have to know which of thos dials and buttons are the essential ones. You wouldn't pass your PPL but with a few hours practice you could take it off, fly a simple circuit around a country airfield and land it without breaking anything as long as the weather was good. If you want to find LAX in a thunderstorm, that's another matter.

 

So I guess what I'm suggesting is a book on what I would really need to know to fly a basic Filemaker circuit without any complicated needs. The basic 5% of the program that is essential to everyone.

 

Maybe that sort of approach doesn't apply to Filemaker? Dunno but I'd buy the book!

Share this post


Link to post
Share on other sites
AHunter3

I can't recommend any book, really. I probably picked up FileMaker (and the Mac OS and computers in general for that matter) at the ideal time when they were all so simple that the way you learned them was to open them and examine them. My attitude was "if I have to read the manual to figure this thing out, it's so badly written I wouldn't want to use it". FileMaker's user manual finally came out of the shrinkwrap only when I first wanted to summarize data. (Doing a subsummary report in Filemaker 2.1, which had no "report wizard" for new layouts, was one of the few non-intuitive things about it).

 

Has Filemaker gradually become so cumbersome and convoluted that it is no longer a "who needs a manual" kind of program? Or do today's newbies want things from a database right from the start that are more complicated than what we expected from databases as newbies back in the day?

 

Maybe there should be a "compatibility mode" button that hides all commands and options introduced after a specified version. Hide all post- Filemaker 2 features until the new user has learned that much, then turn on the FileMaker 3-6 era features and ramp up on those, then turn on the rest for the full-blown experience. I suppose it would lead to some bad practices (copy and paste; repeating fields) that would need to be unlearned, but I'm not sure it wouldn't be worth it if folks really find FileMaker intimidating.

 

On the other hand, it does seem like a lot of newbies come in wanting to be able to do fairly complex things. In the old day we would have simply said "No, that isn't how it works, you don't get to type a few words and have the screen turn blue if the last person who typed those words is drinking decaffeinated coffee at their desk" or whatever; and inquired about the user's purpose and intent and redirected the user to think in FileMakerish terms "OK have the user fill in this field with their coffee type, and set these two fields to auto-enter modification date and time...now here is how you perform a find..."

 

Nowadays there are far more things you can actually DO in FileMaker (it doesn't always making the doing of those things a good idea) and so people are quickly mired in script triggers, conditional formatting, custom functions, cascading type-ahead, tabs, custom menus, etc, before they get the basics of "design a few layouts, make sure you know how to do finds, get a handle on where and how you need different tables and how to set up relationships and navigating between related record sets, do some basic scripting with Set Field and finds and simple Loops". And because of that, the simplicity and ease of use of FileMaker is perhaps buried beneath the peripheral bells and whistles of ancillary functionalities.

Share this post


Link to post
Share on other sites
Josh Ormond
But that's a lot of reading and a lot of it isn't yet of use to me while some of it never will be. There must be vital basics that everyone needs all the time...

 

Filemaker is so vast and I can't even imagine why someone would need some of the functions, but I do find myself needing ones that only a week ago didn't mean anything to me. But I usually discover them by accident.

 

So the trick is not knowing everything but knowing what are the subjects that you really need to know about. (Crikey I sound like Rumsfeld!)

 

Some Photoshop manuals are pretty good in starting people off with the basics without confusing them with stuff they don't need right away. The program is endless in its possibilities, but when you're starting out it's best to get a grip on the basic techniques, tips and tricks which everyone needs. That's only 5% of the program. The rest you learn later if and when you need it.

 

When a friend asks me where to start in photography I think I know the essential tips and techniques he'll need to do the basics. He won't be a wizard right away and he'll discover the advanced stuff later. He might even get by forever with the initial basics if that's good enough for his needs.

 

I hear you. And I agree...don't let my ramblings lead you astray.

 

I understand what you mean, completely. There are a couple of White Papers out there that do a nice job giving you the basics...and at least one of them is free. But we find here that, like Allan said, some newbies are looking to do some pretty complicated stuff...specifically engineered to an end goal. And even if they have the books, they don't have the experience to apply the principles of one application of a technique to another situation.

 

Also, I think the nature of the database solutions is slightly different than other software products. In a program like Photoshop, everyone that uses it is looking to alter a picture in some way. Giving someone steps to do it one way, usually won't come back to bite them latter on in the project. But with FileMaker (or any Database Management System) your structure relies completely on the context of it's use. And is dependent on the developer's knowledge of relational theory. We run into a number of users that followed some suggested setup, only to find that it doesn't work for their situation...and they blame FileMaker. In all the years I have used Photoshop, I have never run into that. Now, mind you, that was a serious over-simplification of the thought process in my head.

 

So I guess what I'm suggesting is a book on what I would really need to know to fly a basic Filemaker circuit without any complicated needs. The basic 5% of the program that is essential to everyone.

 

Maybe that sort of approach doesn't apply to Filemaker? Dunno but I'd buy the book!

 

Check out David Kachel's White Paper for FileMaker Novices. It does a pretty good job, but even that is 100 pages or so.

Share this post


Link to post
Share on other sites
mikey123

CobaltSky, I find your Bible indispensable and I consult it every time I am looking for a specific answer.

 

The Bible is great but I guess what I'm asking for is "The Book of Common Prayer" for Filemaker!

 

"Computers are useless, they can only give you answers": Pablo Picasso.

Share this post


Link to post
Share on other sites
mikey123

jormond you hit the nail right on the head.

 

I could come here every time I'm stumped because it's a lot quicker than figuring out what to look for in the books.

 

But there is the question of respecting the time of those of you who have the knowledge, sometimes because that knowledge is basic to how you make your living. You have families to feed and better things to do than sorting out clueless newbies with questions that have been asked before (some of them can be found by search but not all).

 

There is one thing that would be useful. Maybe it exists, but I haven't found it. I have looked at all the FM10 Quick Start Solutions but I often don't understand precisely why they work (portals and lookups are the most difficult notions to follow). I'd like someone to do an autopsy on every line, every script, the use of every variable and the mechanics of every portal and lookup.

 

Sometimes I just copy and paste from a Quick Start solution into one of my own files, but that doesn't mean I fully understandf how it works. That makes any debugging very difficult. It would help if the Quick Start solutions were commented more.

 

So I'll say it again : I'd buy the book!

Share this post


Link to post
Share on other sites
mikey123

We're getting off topic but let me illustrate by something I do know more about than Filemaker.

 

When people want to know about the basics of exposure in photography they should be asking the following 6 questions.

 

How do I expose for...

1/ a black cat in a coal mine?

2/ a white cat in a coal mine?

3/ a black cat in a snow drift?

4/ a white cat in a snow drift?

5/ a white cat on the lawn?

6/ a black cat on the lawn?

 

But no one ever asks those questions because they might never want to photograph a cat, but I answer them anyway. And if they understand the principles behind the 6 answers and the limitations that go with each case, it's all they'll ever need to know about photographic exposure.

 

So, are there 6 Filemaker questions a beginner should absolutely know the answers to?

 

BTW, David Kachel's White Paper looks like a very useful resource.

Share this post


Link to post
Share on other sites
This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  



×
×
  • Create New...

Important Information

Terms of Use