Comments

Everything you can put in a calculation has some kind of value—unless it’s a comment. Comments are chunks of text whose sole purpose is to help guide you through long calculations. Professional database developers, like all good programmers, provide lots of comments for the benefit of people who might work on the computer code months or years later. Once you have a few sets of parentheses or nested function calls, you may have trouble understanding even your own FileMaker calculation when you have to go back and make changes. When it evaluates the calculation, FileMaker ignores all comments completely—it’s as if they weren’t there. (But you’ll be glad they are.)

Note

You may have noticed that this book shows some extras spaces and paragraph returns that FileMaker doesn’t throw into your functions automatically. These spaces are for ease of reading, and lots of developers type them into their calculations. Like comments, FileMaker ignores those spaces, as long as all the other syntax is correct.

You can use two different styles for your comments. First, any text that comes after two consecutive slash marks (//) is considered a comment. This kind of comment goes all the way to the end of the line.

	// this is a comment
	3.14 * Diameter // and so is this

A comment is also any text that comes between the symbols /* and */. This symbol pair comes in handy in two places. It saves typing if you need to type a long comment across multiple lines:

 /* this is a comment that runs across ...

Get FileMaker Pro 9: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.