3 Replies Latest reply: May 15, 2014 10:11 AM by elginreigner _ RSS

    How to Trap something that can Move

    chuck.kennedy _

      I have an inventory report that I use monarch on.  If the scanners we use to do the inventory mess up, the report will have a ">" right in front of the physical count.  This ">" causes a huge variance in our system.  I want to make the monarch detect this ">" and flag it for us to prevent this.  The problem is depending on the qty of the physical count ie. 1 or 10 or 100, the ">" symbol will be in 1 of 3 different places  >1, >10, >100.  I know there is a "floating trap" but I am not sure how that works.

       

      Any suggestions on how to detect this ">"?

       

      Thanks

      Chuck

        • How to Trap something that can Move
          Olly Bond

          Hello Chuck

           

          This is one of those cases where posting a couple of lines between CODE tags would really help.

           

          You could use the > as a trap character to start the field after it occurs, but if its intermittent that wont help.

           

          You could also just grab the >100 as a text field and use Val() to get the numeric value.

           

          If the >100 field varies in width enough to knock other fields over along the line, perhaps an LSplit(Intrim()) would return what you need.

           

          Best wishes

           

          Olly

            • How to Trap something that can Move
              Grant Perkins

              Olly has it right Chuck.

               

              Your safest option, usually, is to forget about try to trap the field directly through the template and just grab the string and manipulate, it using 'slice and dice' techniques available with the Monarch Functions, to create a new calculated field ( Or maybe more than one calculated field for some challenges) in the table.

               

              This is especially powerful where the field sizes in a report may not be as consistent as one would like from one report output to the next. Using slice and dice you can build in safety margins to ensure the future compatibility can be accomodated. It's very worthwhile to gain familiarity with the 'text' manipulation abilities of Monarch. Certain challenges become non-challenges when you can look at them form a different direction.

               

               

              HTH.

               

               

              Grant