In the FileMaker platform, there are a series of reserved words that have been covered before and are well documented. You can see a listing of those reserved words in the references section at the end of this post.
Lesser known are the named constants that are part of those reserved words. In computer programming, a constant is a value that does not change and cannot be altered. When assigned an identifier, or name, the value can be referenced as a “named constant” interchangeably with the value itself.
Here is a table of the named constants used in FileMaker, and their associated value:
Interestingly, the numbers used appear to be an 8-bit safe number sequence, which makes perfect sense in a programming language. You can see some interesting results using the Data Viewer if you have the Advanced Tools enabled in your copy of FileMaker Pro 17 or are running an Advanced version of FileMaker Pro by seeing the result of the following calculations:
Bold + Underline
You could also use the value interchangeably such as in the JSON functions, for example:
JSONSetElement ( $json ; "name" ; "Mike" ; 1 )
is equivalent to writing:
JSONSetElement ( $json ; "name" ; "Mike" ; JSONString )
That being said, I do NOT recommend replacing the named constant with their corresponding value. While these are unlikely to change in future versions, as a matter of best practice I would always use the named constant, as recommended in the official documentation. I have occasionally seen, especially in the case of JSON functions, values used in place of their named constant.
Using named constants makes programming code self-evident as well as easier to understand and read. Rather than memorizing an obscure set of numbers, you can use names to reference what those numbers are.