10 Replies Latest reply on Aug 11, 2016 12:06 PM by TSGal

    Minor documentation omission for "Set Selection" script step

    scottworld

      A few very minor omissions in the documentation for the "Set Selection" script step:

       

      - If you specify "0" as the "End Position", the cursor will blink right before the specified "Start Position" instead of highlighting any text.

      - If the Start Position is greater than the End Position, the cursor will ALSO blink right before the specified "Start Position".

      - If you specify "0" as the "Start Position", the cursor will blink immediately after the specified "End Position" instead of highlighting any text.

        • 1. Re: Minor documentation omission for "Set Selection" script step
          TSGal

          scottworld:

           

          Thank you for your post.

           

          Your observations are correct.  If you enter 0 or a negative value for the Start or End positions, then none of the string will be highlighted.

           

          I have sent your comments to the manager of our Product documentation.

           

          TSGal

          FileMaker, Inc.

          • 2. Re: Minor documentation omission for "Set Selection" script step
            scottworld

            Thanks. It is true that none of the string will be highlighted, and by specifying 0 (or negative) values, you can make the cursor blink within different areas of the field. So that was my key point that I was getting at: this function has the hidden ability to make the cursor blink in different areas of the string... instead of highlighting parts of the string.

            • 3. Re: Minor documentation omission for "Set Selection" script step
              TSGal

              scottworld:

               

              The Notes under Set Selection in FileMaker Pro 15 Help is fairly thorough.  It does say,

               

              • Field position is determined by the number of characters, including spaces, beginning with position 1, ...

               

              • If the start position is valid and the end position out of range, everything from the start position to the end of the field is selected. If the end position only is valid, the cursor moves to the end position, and nothing is selected. If both start and end positions are invalid, the cursor moves to the end of the field contents.

               

              Although it seems implied, the Help doesn't specifically mention 0 (zero) as being invalid.  This is what was sent to the manager of Product documentation.

               

              TSGal

              FileMaker, Inc.

              • 4. Re: Minor documentation omission for "Set Selection" script step
                scottworld

                I think you're totally misunderstanding what I'm saying here. Let me try to explain in a different way:

                 

                - NOWHERE in the documentation does it say that you can jump the cursor to the BEGINNING of the field contents, without selecting anything.

                - NOWHERE in the documentation does it say that you can jump the cursor to the MIDDLE of the field contents, without selecting anything.

                 

                Forget 0 and the negative numbers. Those are just the tools to accomplish the 2 tasks above.

                 

                The key omission is that the documentation for "Set Selection" fails to let developers know of the 2 most powerful possibilities they have here: jumping the cursor to the BEGINNING of the field contents, and jumping the cursor into the MIDDLE of the field contents -- WITHOUT SELECTING ANYTHING.

                 

                The documentation does not even let the developer know that those 2 things are possibilities. The documentation ONLY talks about SELECTING TEXT or moving the cursor to the END of the field. It doesn't talk about moving the cursor to the BEGINNING or the MIDDLE of the field.

                 

                Until those 2 possibilities are addressed in the documentation, the documentation for this script step will remain incomplete.

                • 5. Re: Minor documentation omission for "Set Selection" script step
                  scottworld

                  Your observations are correct. If you enter 0 or a negative value for the Start or End positions, then none of the string will be highlighted.

                   

                  Sorry, you're missing my point. This isn't about the fact that "none of the string will be highlighted". It's about the fact that YOU CAN CONTROL WHERE IN THE FIELD THE CURSOR IS BLINKING. Please review my 2 most recent comments above for more details on this. This script step allows you to jump the cursor WITHIN THE CONTENTS OF THE FIELD, with no highlighting at all. That is the power of this script step that isn't covered by the documentation.

                  • 6. Re: Minor documentation omission for "Set Selection" script step
                    scottworld

                    In other words,

                     

                    Users should know that they can do 4 THINGS WITH THIS SCRIPT STEP. However, the documentation only outlines that the users can do 2 THINGS with this script step. These are the 4 things users can do with this script step:

                     

                    1. Move cursor to beginning of field, without selecting anything.

                    2. Move cursor to end of field, without selecting anything.

                    3. Move cursor into the middle of the field, without selecting anything.

                    4. Select text within the field.

                     

                    The documentation only covers 2 of those 4 possibilities... the documentation needs to cover all 4 of those possibilities.

                     

                    The way to accomplish the missing possibilities is by creatively using numbers for start position and end position:

                     

                    - MOVE CURSOR TO BEGINNING OR MIDDLE OF FIELD (without highlighting anything): If you specify "0" as the "End Position", the cursor will blink right before the specified "Start Position" instead of highlighting any text.

                    - MOVE CURSOR TO BEGINNING OR MIDDLE OF FIELD (without highlighting anything): If the Start Position is greater than the End Position, the cursor will ALSO blink right before the specified "Start Position".

                    - MOVE CURSOR TO MIDDLE OR END OF FIELD (without highlighting anything): If you specify "0" as the "Start Position", the cursor will blink immediately after the specified "End Position" (within the middle of the text).

                    1 of 1 people found this helpful
                    • 7. Re: Minor documentation omission for "Set Selection" script step
                      TSGal

                      scottworld:

                       

                      I have sent along your additional comments.

                       

                      TSGal

                      FileMaker, Inc.

                      • 8. Re: Minor documentation omission for "Set Selection" script step
                        TonyWhite

                        Hi TSGal

                         

                        Following are some deletions and additions that could be made to this page...
                        https://www.filemaker.com/help/15/fmp/en/index.html#page/FMP_Help%2Fset-selection.html%23wwconnect_header
                        ...that would showcase the FileMaker platform more accurately and effectively, increasing market share and profits!

                        Set Selection
                        Purpose
                        Designates the starting and ending position of a selection in a field.
                        Has 2 uses:
                        1. Selects a range of character based on a starting and ending position
                        2. Sets the location of the cursor without selecting text

                        ...

                        Options
                        Go to target field specifies the field whose contents you want to select. If no target field is specified the current active field is used.
                        Start Position specifies the starting position of the selection.
                        End Position specifies the ending position of the selection.


                        Description
                        The starting and ending values can be typed in directly or determined via a calculation. If no target field is specified the current active field is used.


                        Notes
                        •Field position is determined by the number of characters, including spaces, beginning with position 1, the first character in the field. The selection includes all values beginning with the Start Position and concluding with the End Position. For example, if Field1 has the value “abcdefgh”, and the script parameters specify a start position of “3” and an end position of “6”, the script step will return the selection “cdef”.

                        •If the start position is valid and the end position is out of range greater than the length of the field, everything from the start position to the end of the field is selected. If the end position only is valid, the cursor moves to the end position, and nothing is selected. If both start and end positions are invalid, the cursor moves to the end of the field contents.

                        •No action is taken if the user attempts to perform a selection on a container field.

                        •Data selected out of visual range is scrolled into view. (this offers interesting possibilities)

                        •In FileMaker Go, this script step does not highlight selected text if the keyboard is hidden on the device.

                        Example 1
                        Selects the first 5 digits of the Postal Code field.
                        Set Selection [Customers::Postal Code; Start Position: 1; End Position: 5]

                        Example 2
                        Selects the number of paragraphs that the user specifies in the custom dialog box.
                        Show Custom Dialog ["How many paragraphs do you want to select?"; Products::Number of Paragraphs]
                        If [Get ( LastMessageChoice ) = 1]
                        Set Selection [Products::Description; Start Position: 1; End Position: Position ( Products::Description ; ¶ ; 1 ; Products::Number of Paragraphs )]
                        End If

                        Example 2
                        Sets the selection to the first character of Customers::Postal Code field
                        Set Selection [Customers::Postal Code; Start Position: 1; End Position: 1]

                        Example 3
                        Sets the cursor location to the start of the Customers::Postal Code field [AKA before the first character]
                        Set Selection [Customers::Postal Code; Start Position: 1; End Position: NOT SET]

                        Example 4
                        Sets the cursor location to the start of the current active field (the field that the cursor is in)
                        Set Selection [ no target field -> current active field; Start Position: 1; End Position: NOT SET]

                        Example 5
                        Sets the cursor location after the first character of the current active field (the field that the cursor is in)
                        Set Selection [ no target field -> current active field; Start Position: NOT SET; End Position:1]


                        Related topics
                        ...
                        Get ( ActiveFieldContents )
                        Get ( ActiveSelectionStart )
                        Get ( ActiveSelectionSize )
                        Get ( ActiveFieldName )
                        Get ( ActiveFieldTableName )

                        3 of 3 people found this helpful
                        • 9. Re: Minor documentation omission for "Set Selection" script step
                          scottworld

                          Thanks, Tony, for typing that up!

                          • 10. Re: Minor documentation omission for "Set Selection" script step
                            TSGal

                            TonyWhite:

                             

                            Thank you for taking the time to produce a detailed edit of the Set Selection script step.  I have sent this along to the Documentation manager.

                             

                            TSGal

                            FileMaker, Inc.