7 Replies Latest reply on Jan 26, 2010 9:24 AM by philmodjunk

    Making Notes Within Scripts

    Marty1

      Title

      Making Notes Within Scripts

      Post

      Hi,

      Quick question (well I hope so....)

      I am writing some standard scripts and wish to make some 'non executable' note, only for my benefit, but can not find what the syntax is for programmer notes..

      i.e.

      this part will retreive the relevant value list....

      Many thanks in advance

       

      Marty

        • 1. Re: Making Notes Within Scripts
          ninja
            

          Howdy Marty,

          welcome to the forum.

           

          On the left pane in scriptmaker, down near the bottom of the list, you'll see a step called "Comment".

          • 2. Re: Making Notes Within Scripts
            Marty1
              

            Hi Ninja,

            Many thanks.. gosh always seens so easy when you know how... as you can see I'm a new Rookie to this amazing program.

            Would this addind text notes be the same format when in a field, specifying a calculation..? or what syntax is applicable there...

            Cheers

             

            Marty

            • 3. Re: Making Notes Within Scripts
              ninja
                

              Marty1 wrote:

              Would this addind text notes be the same format when in a field, specifying a calculation..? or what syntax is applicable there...


              Not quite sure what you mean, but let's try it this way...

               

              When you insert the "Comment Step" there will be a "Specify..." button on the lower right.

              Click that button and a typing pane will show up.

              Type in whatever you want...don't worry about syntax...FMP will skip this step when running the script.  It is just a note for yourself or others looking at the script to track why the script is written that way.  It is indeed a "comment".

               

              The Comment script step is not attached to a field or calculation and will be transparent to the script.

              is that what you're asking, or did I miss your question?


              • 4. Re: Making Notes Within Scripts
                Marty1
                  

                Hey Ninja,

                I do beleive that you have understood my question.. However it is my interpretation of the answer I am struggling with..

                I will try again.....

                In a Table I have a feild specified as a calculation..

                when writing the calculation.. I have for example:

                   Case (

                   ValueListItems(Get (FileName); "Categories");

                 

                Now I wish to add a 'user' note to explain what these line of code actually do..

                In the list of available operands I do not see the 'comment' function...

                I have looked under 'all functions by name'

                Thanks

                Marty

                • 5. Re: Making Notes Within Scripts
                  ninja
                    

                  Aha,

                   

                  My post was strictly for doing this within scripts.

                   

                  In a calculation field, you would use the operator /* to start the comment and */ to end the comment.

                   

                  Check out the on-board help in FMP and search for the word "comment"...it gives some appropriate examples of using this in a calculation.

                  • 6. Re: Making Notes Within Scripts
                    Marty1
                      

                    Brilliant...!!

                    Many thaks Ninja, answered all my questions.

                    I will also look at the 'comment' as recommended.

                    All the best

                     

                    Marty

                    • 7. Re: Making Notes Within Scripts
                      philmodjunk
                        

                      In addition to the "in line" comments Ninja has described, you have "comments" column in Manage Database that you can use. I like the in line comments for a lot of my calculations as I can see them while I am working with the calculation and the comment column isn't always visible in those circumstances.

                       

                      Nevertheless, the comments column does have its uses.

                       

                      To add such a comment to a field simply enter the comment into the comment text box at the very bottom of Manage | Database | Fields and click either "change" (an existing field) or "create" (a new field).