9 Replies Latest reply on Jan 15, 2013 1:12 PM by DavidJondreau

    Hidden functionality?



      Hidden functionality?


           I created a script in which I needed to set a field to the value "Other".  What I did not include was the quotes.

           FileMaker accepted this as input, which I thought was strange, but I let it do it's thing.  What happened is

           that FileMaker set the field to the number 10 when the script was run.  

           This begs the question:  Are there other words that when entered without quotes will set fields with data

           that seemingly has nothing to do with what was entered?

           So if:

           Other = 10

           what else can I code into a calculation that will give me output?

           and if this is normal behavior for FileMaker, it would be good to know which words when entered without quotes

           will cause no errors and still enter data.......

        • 1. Re: Hidden functionality?

               True will enter 1. False will enter 0.

               Take a look at TextStyleAdd in FileMaker Help. Note the long list of style options that can be specified with unquoted text. In an expression, each of these will evaluate to a number which is why you can combine styles with expressions such as Bold + Italic with this function.

               Presumably Other has also been so defined for use in a different script step, but the specific case where it is so used doesn't immediately come to mind...

          • 2. Re: Hidden functionality?

                 It's one of the options when editing a value list in a pop-up menu.

            • 3. Re: Hidden functionality?

                   True, but I wouldn't expect that value list feature to require the unquoted text, "Other" to evaluate as the number 10 in a calculation.

              • 4. Re: Hidden functionality?

                     Ok, but something cannot be both true and false ( philosophy majors please refrain from a pointless discussion about this )

                     What I did was:

                     SetField [ FieldName ; Other ]

                     There is no function being used here so why would FileMaker accept this as a valid input?  I would expect it to tell me that

                     the specified table cannot be found and prompt me to enter something in quotes or select a field from one of the tables.

                     It does neither, so the question still is, why is FileMaker allowing this? and is there a purpose for it?

                • 5. Re: Hidden functionality?

                       An expression is an expression is an expression.

                       Whether you set up an expression as the parameter to the TextStyleAdd script step or the Set Field script step, Filemaker uses the same rules when evaluating it. If a FileMaker Inc. programmer defines Bold to evaluate as a specific number in TextStyleAdd, you can then use that same keyword in any other expression such as:

                       Set Field [Table::Field ; Bold + Italic ]

                       and you'll get the same calculated numeric result in both cases.

                  • 6. Re: Hidden functionality?

                         If you try to define a field named, Other, it returns this error message:


                         The selected name cannot be easily used in a calculation formula because it
                           • contains: + - * / ^ & = ≠ < > ≤ ≥ ( , ; ) [ ] " :: $ }
                           • contains: AND, OR, XOR, NOT
                           • begins with a digit or a period
                           • or has the same name as a function, parameter or keyword.  Proceed anyway?
                         So I guess it is a  reserved parameter or keyword.
                    • 7. Re: Hidden functionality?

                           That was clearly the case from the very first post in this thread. But I am mildly curious as to which aspect of FileMaker required a FileMaker Inc. programmer to so define it. I can find a number of other keywords that are clearly needed as numeric constants for use with particular script steps, but am not aware of one that requires Other to evaluate as a numeric constant.

                           And this is not something you can easily search for in FileMaker help...


                      • 8. Re: Hidden functionality?

                             Seems Phil is on to something:

                             SetField [ FieldName ; Bold ]

                             enters the number 256

                             Italic = 512

                             Underline = 1024


                             Still a mystery what purpose Other has though.