Commenting FileMaker Scripts

From Dwayne Wright PMP, PMI-ACP
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

The comment script step doesn’t perform an action but is used to add a text note inside of a FileMaker script. This means you can use the Comment step to explain all of the script or perhaps a portion of the overall script.

The ability to document what you have going on in a script may seem like a waste of time, when you are designing the script. However, months or years after the fact, you might find these notes extremely useful. Some describe this as leaving a note for your future self. It can also be an invaluable aid for those databases that may pass from one developer to the next.

HOW TO ADD COMMENTS
To add a comment, you simply choose that script step and then click the Specify button and it will show up on the script. This feature isn’t as robust as most developers would like. It would be great if the comments could be exported in some intelligent way to build a log of your solution scripts.


Here you can see where the comments script step is found.


Here you can see how you add a comment script step


Here you can see an example of a commented script

A GREAT TECHNIQUE
I heard of a really great technique being used by another local Seattle developer called John Sindelar with SeedCode (www.seedcode.com) from the adatasol FileMaker podcast (search for filemaker in iTunes to subscribe).

The idea is to add all your comments first, before you add any of the script steps themselves. This helps you plan your script before you script your plan. After adding the script comments you need, you add all the necessary scripts steps. This can be very useful for two reasons ...

1) If you get pulled away from your database and have to close it, you are much less bewildered when you come back to the script a few minutes, hours or days later.

2) As you add your script comments, you might get inspired for a better way to write your script. This is a time saver because you don’t have any script routines you have to delete or edit yet.

Here you can see some comments in a script.

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.