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

Re: [Clip] Array

Expand Messages
  • Axel Berger
    ... Solved it. I can t use a function in there but I can nest variables, so I need to invent another variable to store that 02 in. But that too does not
    Message 1 of 9 , Feb 8, 2009
    • 0 Attachment
      Axel Berger wrote:
      > ^%varMON^$StrCopy("^%varDAT%";3;2)$%

      Solved it. I can't use a function in there but I can nest variables,
      so I need to invent another variable to store that "02" in. But that
      too does not quite work, it needs to be single digit, i.e. not "02"
      but "2". That I think is a weakness and ought to be amended by the
      next update.

      Axel
    • Axel Berger
      ... Until it is, this works to get rid of leading zeroes: ^!Set %varMON%=^$Calc(^$StrCopy( ^%varDAT% ;3;2)$;0)$ Axel
      Message 2 of 9 , Feb 8, 2009
      • 0 Attachment
        Axel Berger wrote:
        > That I think is a weakness and ought to be amended by the
        > next update.

        Until it is, this works to get rid of leading zeroes:

        ^!Set %varMON%=^$Calc(^$StrCopy("^%varDAT%";3;2)$;0)$

        Axel
      • ebbtidalflats
        Axel, You could use either a single M for month in your date function. If you need the double mm for some other reason, use separate date function with only
        Message 3 of 9 , Feb 8, 2009
        • 0 Attachment
          Axel,

          You could use either a single 'M' for month in your date function.

          If you need the double mm for some other reason, use separate date
          function with only a single M as argument to get a month number
          without leading zero:


          ^!Set %z%=^$GetDate(M)$
          ^!Set %month%=^%array^%z%%


          This would be MUCH faster than ^$calc, much more readable than
          stripping any leading '0' from a two char month number.


          Cheers,


          Eb
        • Axel Berger
          ... I could, but I don t use a date function. The YYMMDD string, e.g. 090209, is part of a file naming and anchor naming scheme. ... Probably, but speed is
          Message 4 of 9 , Feb 8, 2009
          • 0 Attachment
            ebbtidalflats wrote:
            > You could use a single 'M' for month in your date function.

            I could, but I don't use a date function. The YYMMDD string, e.g.
            090209, is part of a file naming and anchor naming scheme.

            > This would be MUCH faster than ^$calc,

            Probably, but speed is irrelevant here. The function is part of a
            Html wizard for formatted calendar entries and relieves me from
            typing the same old stuff over and over again. I'd rather type a
            single string like 090209 and leave it to the machine to split that
            apart as needed than having separate fields for year, month, and
            day. This is the finished product, but it does not make a lot of
            sense out of context:

            ^!Set %varDAT%=^?{Datum: }; %varCLS%=^?{(T=L)Class:
            =_blau|grau|weiss|gelb}

            ^!IfEmpty "^%varDAT%" SKIP

            ^!InsertHtml <P CLASS="grau vortit bigskip">^P^%varDAT%</P>^P^&

            ^!InsertHtml <DIV CLASS="gelb"><H2
            CLASS="^%varCLS%">^P^&^P</H2></DIV><!-- end .GELB -->

            I really must move over my LaTeX editing to NoteTab too, I do hate
            all that unnecessary typing.
            By the way: The /L /C and /INI switches are a great tool when
            starting NoteTab by double-clicking or right-clicking a file, but
            there seems to be no way to start NoteTab first, and then load
            another ini file or switch it in a running NoteTab. Perhaps i need
            to place several entries into the Windows Start menu.

            Axel
          • Axel Berger
            ... Wrong example, this is the one I meant: ^!Set %varDAT%=^?{Datum 6St: =^%varDAT%}; %varSTW%=^?{Schlagwort: =^%varSTW%} ^!Set
            Message 5 of 9 , Feb 8, 2009
            • 0 Attachment
              Axel Berger wrote:
              > This is the finished product

              Wrong example, this is the one I meant:

              ^!Set %varDAT%=^?{Datum 6St: =^%varDAT%}; %varSTW%=^?{Schlagwort:
              =^%varSTW%}

              ^!Set %varMON%=^$Calc(^$StrCopy("^%varDAT%";3;2)$;0)$

              ^!SetArray %varMNN%=". Januar ";". Februar ";". März ";". April ";".
              Mai ";". Juni ";". Juli ";". August ";". September ";". Oktober ";".
              November ";". Dezember "

              ^!InsertHtml <DIV CLASS="weiss par"><P
              CLASS="gelb">^P^$StrCopyRight("^%varDAT%";2)$^%varMNN^%varMON%%20^$StrCopyLeft("^%varDAT%";2)$<BR>^P<A
              HREF="/pages/Termine.shtml#a^%varDAT%">^P^%varSTW</A>^P</P></DIV><!--
              end # .WEISS PAR -->^P^&^P

              Axel
            • Alec Burgess
              Axel Berger (Axel-Berger@nexgo.de) wrote (in part) (on 2009-02-08 at ... Are you sure? Have you looked at ^!ProgIniLoad and ^!ProgIniSave? ... From the few
              Message 6 of 9 , Feb 8, 2009
              • 0 Attachment
                Axel Berger (Axel-Berger@...) wrote (in part) (on 2009-02-08 at
                18:46):
                > By the way: The /L /C and /INI switches are a great tool when
                > starting NoteTab by double-clicking or right-clicking a file, but
                > there seems to be no way to start NoteTab first, and then load
                > another ini file or switch it in a running NoteTab. Perhaps i need
                > to place several entries into the Windows Start menu.
                Are you sure?
                Have you looked at ^!ProgIniLoad and ^!ProgIniSave?
                > ^!ProgIniLoad [IniName] (added in v4.6)
                >
                > Loads options from the NoteTab ini file or registry. Optionally, you
                > can specify an alternative INI file (it must exist or else the command
                > sets the error condition). Note that the [AutoLoad] section is ignored
                > by this command.
                >
                > ^!ProgIniSave [IniName] (added in v4.6)
                >
                > Saves the current program settings into the NoteTab ini file or
                > registry. Optionally, you can specify an alternative INI file (it is
                > automatically created if it does not exist).
                From the few times I've used these commands I remember them as being a
                bit tricky to get right, but I'm pretty sure they will do what you want.

                Search Yahoo archives - for example:
                > 17235 Re: [Clip] clip to number rows
                > <http://tech.groups.yahoo.com/group/ntb-clips/message/17235>
                > ... can change NoteTab's options with clips, but before making a
                > change you need ^!ProginiSave, and after the change you need
                > ^!*ProgIniLoad*. So: ^!ProgIniSave ^!SaveValue Options:NbrSeparator=":
                > " ^!*ProgIniLoad* will immediately cause the number separator option ...
                --
                Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)




                [Non-text portions of this message have been removed]
              • Axel Berger
                ... I had been thinking about direct menu commands, but thanks for the hint. I ll go and look into it. Axel
                Message 7 of 9 , Feb 8, 2009
                • 0 Attachment
                  Alec Burgess wrote:
                  > Have you looked at ^!ProgIniLoad and ^!ProgIniSave?

                  I had been thinking about direct menu commands, but thanks for the
                  hint. I'll go and look into it.

                  Axel
                • ebbtidalflats
                  Well, with NoteTab there is always more than one way to skin a cat. Back in the days BEFORE NT had arrays, we used to create FAKE arrays. ^!Set
                  Message 8 of 9 , Feb 10, 2009
                  • 0 Attachment
                    Well, with NoteTab there is always more than one way to skin a cat.


                    Back in the days BEFORE NT had arrays, we used to create FAKE arrays.

                    ^!Set %array01%=January; %array02%=February; ... %array12%=December

                    End result, it works just like an array, but you can use STRINGS to
                    access the individual elements:

                    ;extract the month's 2-digit number
                    ^!Set %monthstring%=^$StrCopy("^%date%";3;2)$
                    ;use it as array index
                    ^!Set %month%=^%array^%monthstring%%


                    You'd have to translate the names to your appliction. But you will not
                    need the intransparent code to strip leading zeros from a string.


                    Eb


                    --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:
                    >
                    > ebbtidalflats wrote:
                    > > You could use a single 'M' for month in your date function.
                    >
                    > I could, but I don't use a date function. The YYMMDD string, e.g.
                    > 090209, is part of a file naming and anchor naming scheme.
                  Your message has been successfully submitted and would be delivered to recipients shortly.