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

[Clip] Re: min+sec

Expand Messages
  • Kay Roath
    08/25/1999 12:53 PM Raymond Fitzgerald wrote ... Duh! I looked at the functions list in Help/Math several times because I was sure MOD had to be there &
    Message 1 of 19 , Aug 26, 1999
    View Source
    • 0 Attachment
      08/25/1999 12:53 PM Raymond Fitzgerald wrote
      > ^$Calc(129 DIV 60)$ = 2
      > ^$Calc(129 MOD 60)$ = 9

      Duh! I looked at the functions list in Help/Math several
      times because I was sure MOD had to be there & totally
      missed it in the Accepted Operators right above where I was
      looking. Thanks for those examples :)

      --- Grandma Kay ---
    • Charles M. Raine
      Hi Clippers: Here is a revised version of MY routine to add time values. This version will handle Hours, Minutes and Seconds and after much testing, I have not
      Message 2 of 19 , Aug 26, 1999
      View Source
      • 0 Attachment
        Hi Clippers:

        Here is a revised version of MY routine to add time values. This version
        will handle Hours, Minutes and Seconds and after much testing, I have not
        been able to find a problem with it. It may not be beautiful code, but it
        works! The first clip is a testing routine.

        If anyone finds a problem with this clip, please let me know.

        ---------< start clip >---------
        H="Add Times"
        ; Charles M. Raine <rainec@...>
        ; 08/26/1999, 02:27:49 PM
        ^!ClearVariables
        ^!SetWizardTitle Total Time Values
        ^!SetWizardLabel Enter any amounts as hh:mm:ss.
        ; A long Line.
        ^!Set %time1%=^?{Enter Time 1 (Example 1:50:24)=1:50:24}; %time2%=^?{Enter
        Time 2 (Example 1:49:45)=1:49:45}
        ; End long line.
        ^!Set %time%=^%time1%
        ^!Clip "ConvertT"
        ^!Set %time1%=^%time%
        ^!Set %time%=^%time2%
        ^!Clip "ConvertT"
        ^!Set %time2%=^%time%
        ^!Clip "Calculate"
        ^!Info Total = ^%total%
        ---------< end clip >-----------


        ---------< start clip >---------
        H="_ConvertT"
        ; Charles M. Raine <rainec@...>
        ; 08/26/1999, 02:27:49 PM
        ^!If ^$StrCount(":";"^%time%";false;false)$<>1 Next ELSE End
        ^!Set %pos%=^$StrPos(":";"^%time%";false)$
        ^!Set %hour%=^$StrCopy("^%time%";1;^$Calc(^%pos%-1)$)$
        ^!Set %min%=^$StrCopy("^%time%";^$Calc(^%pos%+1)$;2)$
        ^!Set %time%=^$Calc(^$Calc(^%hour%*60)$+^%min%)$^$StrCopyRight("^%time%";3)$
        ---------< end clip >-----------


        ---------< start clip >---------
        H="_Calculate"
        ; Charles M. Raine <rainec@...>
        ; 08/26/1999, 02:27:49 PM
        ; Charles M. Raine <rainec@...>
        ; 08/25/1999, 07:23:01 PM
        ; This routine will work for Hours, Minutes & Seconds.
        ; Convert times to Decimal Values.
        ^!Set %time1%=^$StrReplace(":";".";"^%time1%";false;false)$
        ^!Set %time2%=^$StrReplace(":";".";"^%time2%";false;false)$
        ^!Set %total%=^$Calc(^%time1%+^%time2%;2)$
        ^!Set %decimal%=^$StrCopyRight("^%total%";3)$
        ^!If ^%decimal >= .60 Next ELSE Skip
        ^!Set %total%=^$Calc(^%total%+.40)$
        ^!If ^$StrSize("^%total%")$<4 Next ELSE Skip
        ^!Set %total%=^%total%.00
        ^!Set %pos%=^$StrPos(".";"^%total%";false)$
        ^!Set %hhmm%=^$StrCopy("^%total%";1;^$Calc(^%pos%-1)$)$
        ^!Set %hour%=^$Calc(^%hhmm% DIV 60)$
        ^!If ^%hour%=0 Next ELSE Skip_2
        ^!Set %hour%=""
        ^!GoTo Skip
        ^!Set %hour%=^%hour%:
        ^!Set %min%=^$Calc(^%hhmm% MOD 60)$
        ^!If ^%min%<10 Next ELSE Skip_2
        ^!Set %total%=^%hour%0^%min%:^$StrCopyRight("^%total%";2)$
        ^!GoTo End
        ^!Set %total%=^%hour%^%min%:^$StrCopyRight("^%total%";2)$
        ---------< end clip >-----------

        Charlie.

        Charles M. Raine Home Page: http://www.escape.ca/~rainec
        Phone (204) 895-0940 ICQ # 300058
        Winnipeg, Manitoba, Canada
      • Jody
        Hi Charles, When you add all the Start/End Clips in between Clips you defeat the purpose of using the H=Add to Clipboard method. I have to first bring them
        Message 3 of 19 , Aug 26, 1999
        View Source
        • 0 Attachment
          Hi Charles,

          When you add all the Start/End Clips in between Clips you defeat
          the purpose of using the H=Add to Clipboard method. I have to
          first bring them into NoteTab and delete the middle ones or re-
          copy each Clip separtely the adding. If you just use one Start
          and one end around all the clips then all of them can be added at
          once from the Clipboard.

          >---------< start clip >---------
          >H="Add Times"
          >---------< end clip >-----------
          >
          >---------< start clip >---------
          >H="_ConvertT"
          >---------< end clip >-----------
          >
          >---------< start clip >---------
          >H="_Calculate"%";2)$
          >---------< end clip >-----------

          Happy Clip'n!
          Jody

          The NoteTab Clip List...
          mailto:Ntb-Clips-Subscribe@...
          mailto:Ntb-Clips-UnSubscribe@...
        • Jody
          Hi Charles, ... Very true. What I meant was that once the Clips are added from the Clipboard, then I will go through each one deleting the ; ,
          Message 4 of 19 , Aug 26, 1999
          View Source
          • 0 Attachment
            Hi Charles,

            >> That would work although I will still need to delete the
            >> commented <-- Start/End --> etc.,
            >
            > No that won't work because there must be a blank line BEFORE
            > a Header.

            Very true. What I meant was that once the Clips are added from
            the Clipboard, then I will go through each one deleting the
            "; <-- Start -->", etc.

            > From my perspective, I guess the purpose of the wrappers is to
            > delineate the beginning and ends of the clips for the less
            > experienced NoteTab users. As I said, it is really a matter of
            > personal preference. No hard feelings either way, really.

            OK, I understand what you are saying and see your point, but I
            think some of the inexperienced users are going to be writing in
            saying, "It works, but it keeps pasting <-- Start Clip -->, etc.
            into my document.

            Speaking of personal preference I think the best method is the
            way we use to do it most the time. That was with instructions in
            the wrapper. It does not look as pretty, but it tells those that
            do not know how to copy a clip from the list how to get it into a
            Clipbook. One wrapper like you are doing, but around all the
            Clips with a couple lines added before the Clip telling them what
            to do work as well. I posted that info at the beginning of the
            thread, because newcomers do not know what to do with them when
            they are not told. I like to at least try out all the Clips that
            hit the list even if I know I don't need them. I think we all
            are way too busy to have to do extra work to get them into the
            Clipbook.

            <--- Copy below this line --->
            H=Happy Clip'n
            ; 08-26-1999, Ntb-Clips@..., jody
            ^!StatusShow Happy Clip'n Ntb-Clips-Subscribe@...
            ^!Delay 25
            ^!Clip "L8TR G8TR"

            H=L8TR G8TR
            ; 08-26-1999, Ntb-Clips@..., jody
            ^!StatusShow CYA L8TR G8TR... ;-)
            ^!Delay 15
            ^!StatusClose

            <--- Copy above this line, right --->
            <--- click over the Clipbook and --->
            <--- choose "Add from Clipboard" --->

            So, you could leave your single line start/end wrapper and above
            the Clips add something like:

            Copy the Clips between the wrappers, right click over a Clipbook
            where you want to add them, and choose "Add from clipbook."

            <------- Start Clip ---------->
            ....
            <-------- End Clip ---------->

            Happy Clip'n!
            Jody

            The NoteTab Clip List...
            mailto:Ntb-Clips-Subscribe@...
            mailto:Ntb-Clips-UnSubscribe@...
          • Jody
            Hi Larry, ... Well, true, but I usually do not copy my own Clips back to the Clipbook. I have done it though when a correction needs to be made and answer
            Message 5 of 19 , Aug 26, 1999
            View Source
            • 0 Attachment
              Hi Larry,

              > I think that anyone can easily write the clip to work the other
              > way if they wish and I think that you already have done so if I
              > understand your previous posts.

              Well, true, but I usually do not copy my own Clips back to the
              Clipbook. <g> I have done it though when a correction needs to
              be made and answer yes to the "it esists" question.

              I can also see where wrapping them separately wouldn't matter if
              they were non-related and the user might open a new doc and put
              them in other places but he can do that with a single wrapper as
              well.

              BCNU L8TR G8TR,
              Jody Adair

              ICQ 6676919
              http://www.sureword.com/sojourner/
              http://www.sureword.com/kjb1611/
              http://www.sureword.com/notetab/
            Your message has been successfully submitted and would be delivered to recipients shortly.