7 Replies Latest reply on Aug 10, 2009 9:21 AM by comment_1

    Scripting: Problem ought to be easy but I am simply frustrated ...

    MstrPBK

      Title

      Scripting: Problem ought to be easy but I am simply frustrated ...

      Post

      FileMakerPro 8.5 Advanced

       

      ... almost ready to give up and trash 30 yeares of work.

       

      Feild A is a summery total of tick mark in Feild Z

      Feild B is a simple transfer of Feild A to Feild B (since Feild A is used for counting) 

      $$Value C is the tick mark count of feilds equaling "x" value

      $$Value D is the tick mark count of feilds equaling "y" value

      $$Value E is the the adding of 1  IF  $$Value C and/or $$value D are greater than 0 (zero)

      Feild F is Feild B - ($$Feild C + $$Feild D) + $$Vulue E

       

      The DataViewer can track all the values above ...

      The database itself does not reflect that Feild F has recieved the calculated value assigned to it - and remains empty.

      I have spent 6 hours trying to account for all conceiveable problmes and I keep getting no where.  I know what I want to acheive ought to be "easy" but it is wearing me thin.

       

      (minor rant)

      I can't get to the local users group due to late evening bus service, and the lack of dependable transportation.  I am feeling isolated, frustrated, and beginning to loose confidence.

       

      Peter Kelley

      St. Paul, MN USA

        • 1. Re: Scripting: Problem ought to be easy but I am simply frustrated ...
          mrvodka
            

          Feild F is Feild B - ($$Feild C + $$Feild D) + $$Vulue E

           

          do you mean ?

          Field B - $$Value C + $$Value D + $$Value E

           

          It may help if you post the real names of these as well as the calcs for E and any scripts that set your fields...

          • 2. Re: Scripting: Problem ought to be easy but I am simply frustrated ...
            comment_1
              

            MstrPBK wrote:
            I know what I want to acheive ought to be "easy"

            Perhaps you should explain what exactly do you want to achieve.


            • 3. Re: Scripting: Problem ought to be easy but I am simply frustrated ...
                

              The problem is that you use $$field(x) to influence the result of a calculationfield. That is not where $ and $$ variables are meant for.

               

              Calculations bases on $$-variables that show their result on a layout will not refresh, they will keep showing the value that they had when you entered that layout. Therefore when you change the content of (one of the) variable(s) that is used in the calculation and you want to refresh the value displayed, you will have to refresh the layout as well.

               

              regards, Menno

              • 4. Re: Scripting: Problem ought to be easy but I am simply frustrated ...
                FentonJones
                   Refresh Window is the step that does this. It is often needed when you have these problems where calculations do not refresh on the layout. If the changes to the values involve related fields, especially in complex calculations, also check the [x] Flush cached join results.
                • 5. Re: Scripting: Problem ought to be easy but I am simply frustrated ...
                     Only when your calc includes related record(s) to obtain a result you should check the "Flush cached join results". Since in this example only a $$-variable is used, checking this option makes no sence (source: FMP-Help: Refresh Window script step)
                  • 6. Re: Scripting: Problem ought to be easy but I am simply frustrated ...
                    MstrPBK
                      

                    I took the weekend off to calm down and try take some distance from this. I am still very very frustrated at the problem.

                     

                    I took a moment to even insert a Refresh Window command thinking that might have been the problem; but as noted else where in this thread that is not the problem.

                     

                    For those who need a inside view what I am trying to acheive let me try to explain to you the best I can (mind you I am developing for those who do not think or even in some cases do think to much [like I do]. Regurdless ...)  IN VERY simplified terms.  A group of records represent a group of professions.  Two segments of professions have 'similar skill sets'.  What I am trying to do is compensate for these similar skills sets in the summary of these records so that they are only counted ONCE.  Therefore I am totaling each subsegments tick marks (the tick mark has other uses but it is a common identifier) saving that count in its own speciallize veriable; adding them together, deducting from the total number of tick marks and THEN adding BACK in a single tick mark for each set that exits so I am count each skill type once.

                     

                    What is NOT HAPPENING is the resulting total is not getting inserted into the feild as it ought to be.  I have check feilds and feild definations for each [all are number - are indeed number defined].  The data viewer says the data ought to be in the feild - but, visably within the database, it is not.  As I said before this ought to be a simple transfer of datum from an script equation into a feild.

                     

                    Thank you for your input ... I will continue to work on this mystery.  At this point I have to guess it is something increadibly stupid that is elluding me. All the more reason why it would halp to have some one at my side and say "think x thing is the problem - let's try it."

                     

                    MstrPBK

                    St. Paul, MN USa

                     

                    • 7. Re: Scripting: Problem ought to be easy but I am simply frustrated ...
                      comment_1
                        

                      I am afraid I didn't understand your description at all.

                       

                      Assuming that by "tick marks" you mean values in a checkbox field named Skills, and that you want to count the number of distinct skill combinations: this is no different than counting the distinct values in any field* - except that here you must make sure first that the checked skills are sorted within the Skills field. Otherwise two combinations of the same skills may be counted as separate.

                       

                      ---

                      (*) See: http://fmforums.com/forum/showpost.php?post/297916/