Loading ...
Sorry, an error occurred while loading the content.

Re: Using a clip to add sections of a document.

Expand Messages
  • John Zeman
    ... Yes, it can be done with NoteTab Light but to be brutally honest since you re new to NoteTab if any of us were to give you a solution you would likely be
    Message 1 of 4 , May 9, 2005
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "Walker, Tracie" <trwalker@c...> wrote:
      > Hello everyone,
      >
      > I'm very new to using NoteTab Light.
      >
      > I usually use it to Find and Replace text in a document.
      >
      > But have a document that has incorrect sums and would like to correct them.
      >
      > The following shows the section that I have to find and change.
      >
      > <section-03>
      > <total-sum>-130.45</total-sum>
      > <total-sum-vat>-13.05</total-sum-vat>
      > <total-sum-net>-117.40</total-sum-net>
      > </section-03>
      >
      > I need to add the <total-sum>-130.45</total-sum> and <total-sum-vat>-13.05</total-sum-vat> and replace the amount in <total-sum-net>-117.40</total-sum-net> with the correct amount.
      >
      > I think I then need to loop this to make change to this section throughout the document.
      >
      > Can this be done using NoteTab Light?
      >
      > I know you are all busy but any help would be appreciated.
      >
      >
      > Tracie


      Yes, it can be done with NoteTab Light but to be brutally honest since you're new to NoteTab if any of us were to give you a solution you would likely be overwhelmed by it.

      In short, you should learn the fundamentals of the clip language that's built into NoteTab first and then ask the question when you have a basic foundation to work from.

      I believe there is a forum to help beginners learn the clip language but I do not have the URL for it handy, perhaps someone else can point you towards it.

      John
    • Hugo Paulissen
      ... since you re new to NoteTab if any of us were to give you a solution you would likely be overwhelmed by it. ... Tracie, I agree with John, but if you find
      Message 2 of 4 , May 10, 2005
      • 0 Attachment
        > >
        > > I know you are all busy but any help would be appreciated.
        > >
        > >
        > > Tracie
        >
        >
        > Yes, it can be done with NoteTab Light but to be brutally honest
        since you're new to NoteTab if any of us were to give you a solution
        you would likely be overwhelmed by it.
        >

        Tracie,

        I agree with John, but if you find your way out, you may be helped
        with this attempt...

        ^!JUMP 1
        :LOOP
        ;First TotalSum
        ^!Find "<total-sum>" S
        ^!IfError NEXT
        ^!Jump SELECT_END
        ^!Set %START%=^$GetRow$:^$GetCol$
        ^!Find "<" S
        ^!SelectTo ^%START%
        ^!Set %TOTALSUM%=^$GetSelection$
        ;Second TotalVAT
        ^!Find "<total-sum-vat>" S
        ^!IfError END
        ^!Jump SELECT_END
        ^!Set %START%=^$GetRow$:^$GetCol$
        ^!Find "<" S
        ^!SelectTo ^%START%
        ^!Set %TOTALSUMVAT%=^$GetSelection$
        ;CALC
        ^!Set %TOTAL%=^$Calc(^%TOTALSUM%+^%TOTALSUMVAT%)$
        ;INSERT INTO TotalSumNet
        ^!Find "<total-sum-net>" S
        ^!IfError END
        ^!Jump SELECT_END
        ^!Set %START%=^$GetRow$:^$GetCol$
        ^!Find "<" S
        ^!SelectTo ^%START%
        ^%TOTAL%
        :NEXT
        ^!Find "<total-sum>" S
        ^!IfError EXIT
        ^!Jump LINE_START
        ^!GoTo LOOP

        Regards,

        Hugo
      • Don - htmlfixit.com
        ... I respectfully disagree. If we help you find the solution to this problem, then you will see how amazing this software is and decide you want to do more
        Message 3 of 4 , May 10, 2005
        • 0 Attachment
          John Zeman wrote:
          > --- In ntb-clips@yahoogroups.com, "Walker, Tracie" <trwalker@c...> wrote:
          >
          >>Hello everyone,
          >>
          >>I'm very new to using NoteTab Light.
          >>
          >>I usually use it to Find and Replace text in a document.
          >>
          >>But have a document that has incorrect sums and would like to correct them.
          >>
          >>The following shows the section that I have to find and change.
          >>
          >><section-03>
          >><total-sum>-130.45</total-sum>
          >><total-sum-vat>-13.05</total-sum-vat>
          >><total-sum-net>-117.40</total-sum-net>
          >></section-03>
          >>
          >>I need to add the <total-sum>-130.45</total-sum> and <total-sum-vat>-13.05</total-sum-vat> and replace the amount in <total-sum-net>-117.40</total-sum-net> with the correct amount.
          >>
          >>I think I then need to loop this to make change to this section throughout the document.
          >>
          >>Can this be done using NoteTab Light?
          >>
          >>I know you are all busy but any help would be appreciated.
          >>
          >>
          >>Tracie
          >
          >
          >
          > Yes, it can be done with NoteTab Light but to be brutally honest since you're new to NoteTab if any of us were to give you a solution you would likely be overwhelmed by it.
          >
          > In short, you should learn the fundamentals of the clip language that's built into NoteTab first and then ask the question when you have a basic foundation to work from.
          >
          > I believe there is a forum to help beginners learn the clip language but I do not have the URL for it handy, perhaps someone else can point you towards it.
          >
          > John

          I respectfully disagree. If we help you find the solution to this
          problem, then you will see how amazing this software is and decide you
          want to do more with it.

          I think the beginner clip list (called clip class list) is now gone.
          There is still a clip class however, which is a zipped series of
          instructions.
          I think this is a list of all "official" groups:
          http://notetab.com/support.php

          I am nowhere on notetab.net finding the clipclass.zip file offered --
          but Jody can tell us where it is no doubt. It used to be at sureword,
          but I think Jody gave up that domain. Under notetab.net it used to be
          here:
          http://www.notetab.net/zip/clipclass.zip
          but I don't think it is there any more.

          A clip could easily take care of this situation -- assuming that I
          understand your question.

          To clarify ...
          Are the surrounding tags always this:
          <total-sum>-130.45</total-sum>
          <total-sum-vat>-13.05</total-sum-vat>
          <total-sum-net>-117.40</total-sum-net>
          Yes or no?

          And those three lines are always one after the other on a new line?
          Yes or no?

          These happen to be negative numbers. Are they sometimes positive and
          sometimes negative?

          I presume the correct number is $143.50 in this case?
          -130.45 + -13.05 = - 143.50?
          Or is the - not really a sign?


          Anyway, if any of my assumptions are correct, than this clip does what
          you want it to do. If you don't know how to use this clip, don't be
          afraid to ask. Basically you copy it and then in a clip library you
          right click and save from clipboard. Give it a name, check the line
          length to be sure no long lines got wrapped. Work on a dummy file to
          begin with to see how it works. Good luck.

          ;*** Effort by Don Passenger
          ;*** don@...
          ;*** discuss things live in chat at http://htmlfixit.com
          ;*******************************************************
          ;*** will take this:
          ;<total-sum>-130.45</total-sum>
          ;<total-sum-vat>-13.05</total-sum-vat>
          ;<total-sum-net>xxxx</total-sum-net>
          ;and calculate the sum-net

          ; always start at the top of the document
          ^!Jump DOC_START

          :LoopSum
          ;find the total-sum tag
          ;find next tag start
          ^!Find "<" TIS
          ;quit when no more tags
          ^!IfError Finish

          ^!ClearVariables
          ;%TAG% will be empty if cursor is not inside a tag.
          ;determine if tag and get the name of the tag
          ;if not "total-sum" cycle to next via NotTag subroutine
          ^!Set %TAG%="^$GetHtmlTag(TRUE)$"
          ^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
          ^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
          ^!If "TOTAL-SUM" = "^%TAGNAME%" TOTAL-SUM ELSE NotTag


          :NotTag
          ^!Jump Select_End
          ^!Goto LoopSum

          ;if TOTAL-SUM tag, get the value
          :TOTAL-SUM
          ;jump to the end of the TOTAL-SUM tag
          ^!Jump Select_End
          ;figure out where cursor is
          ^!Set %row%="^$GetRow$"
          ^!Set %column%="^$GetCol$"
          ;find the start of the /total-sum tag
          ;note I assume it is the next tag
          ;no error checking
          ^!Find "<" TIS
          ;select the number and then load it to a variable
          ^!SelectTo ^%row%:^%column%
          ^!Set %SUM%=^$GetSelection$

          ;NEXT GET THE SUM-VAT VALUE
          ;advance one line
          ^!Jump +1
          ;find the total-sum-vat tag
          ^!Find "<" TIS
          ;quit when no more tags
          ^!IfError Problem
          ^!Set %TAG2%="^$GetHtmlTag(TRUE)$"
          ^!IfTrue ^$IsEmpty(^%TAG2%)$ Problem
          ^!Set %TAGNAME2%="^$GetHtmlTagName("^%TAG2%";UPPERCASE)$"
          ^!If "TOTAL-SUM-VAT" = "^%TAGNAME2%" TOTAL-SUM-VAT ELSE Problem
          ;if TOTAL-SUM tag, get the value
          :TOTAL-SUM-VAT
          ;jump to the end of the TOTAL-SUM-VAT tag
          ^!Jump Select_End
          ;figure out where cursor is
          ^!Set %row%="^$GetRow$"
          ^!Set %column%="^$GetCol$"
          ;find the start of the /total-sum-vat tag
          ;note I assume it is the next tag
          ;no error checking
          ^!Find "<" TIS
          ;select the number and then load it to a variable
          ^!SelectTo ^%row%:^%column%
          ^!Set %SUMVAT%=^$GetSelection$

          ;NEXT DO MATH AND REPLACE THE SUM-NET VALUE
          ;advance one line
          ^!Jump +1
          ;find the total-sum-vat tag
          ^!Find "<" TIS
          ;quit when no more tags
          ^!IfError Problem
          ^!Set %TAG3%="^$GetHtmlTag(TRUE)$"
          ^!IfTrue ^$IsEmpty(^%TAG3%)$ Problem
          ^!Set %TAGNAME3%="^$GetHtmlTagName("^%TAG3%";UPPERCASE)$"
          ^!If "TOTAL-SUM-NET" = "^%TAGNAME3%" TOTAL-SUM-NET ELSE Problem
          ;if TOTAL-NET tag, get the value
          :TOTAL-SUM-NET
          ;jump to the end of the TOTAL-SUM-NET tag
          ^!Jump Select_End
          ;figure out where cursor is
          ^!Set %row%="^$GetRow$"
          ^!Set %column%="^$GetCol$"
          ;find the start of the /total-sum-net tag
          ;note I assume it is the next tag
          ;no error checking
          ^!Find "<" TIS
          ;select the number and then load it to a variable
          ^!SelectTo ^%row%:^%column%
          ;now do the math
          ^!SetClipboard ^$Calc(^%SUM%+^%SUMVAT%)$
          ^!Paste

          ;GET NEXT SET OF TAGS
          ;advance one line
          ^!Jump +1
          ^!Goto LoopSum


          :Problem
          ^!Info [C]we have a tag mismatch -- something is wrong with formatting
          ^!Goto End

          :Finish
          ^!SetScreenUpdate On
          ^!ClearVariables
          ;line 117 if you have all lines unrapped (including blank lines)

          As always I will post a copy to my blog for later finding. It appears here:
          http://htmlfixit.com/blog/index.php?p=318
        Your message has been successfully submitted and would be delivered to recipients shortly.