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

Re: [Clip] Re: self-modifying clip

Expand Messages
  • loro
    ... I always forget about that. I have feeling it s documented somewhere, but I don t find it. Do you know where? Lotta
    Message 1 of 10 , Apr 26, 2010
    • 0 Attachment
      ebbtidalflats wrote:
      >^!Set %var%=If ^%index%=2 END else SOMETHING
      >
      >THEN you can execute the variable content with
      >
      >^!^%var%

      I always forget about that. I have feeling it's documented somewhere,
      but I don't find it. Do you know where?

      Lotta
    • Sheri
      ... I had problems doing that with an older versions, where there were functions in use as command parameters for the variable command. Even reported it at the
      Message 2 of 10 , Apr 26, 2010
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "ebbtidalflats" <ebbtidalflats@...> wrote:
        >
        > Graham,
        >
        > My understanding is, that you have complete clip commands in a variable, say:
        >
        > ^!If ^%index%=2 LABEL_2 else END
        >
        > The way to do what I think you want to do is to set the variable
        > WITHOUT the leading caret and bank. As long as the rest of the line is a legitimat clip command, it should work:
        >
        > ^!Set %var%=If ^%index%=2 END else SOMETHING
        >
        > THEN you can execute the variable content with
        >
        > ^!^%var%
        >
        >
        > WEASEL Clause: this has always worked for me, but there may be
        > some exception that escapes me. I would test any such command
        > with debug on, so I could see if the variable is being parsed
        > correctly.

        I had problems doing that with an older versions, where there were functions in use as command parameters for the variable command. Even reported it at the time. But it does seem to be working now in a few simple tests. Maybe something has changed :D

        Regards,
        Sheri
      • ebbtidalflats
        As far as I know, this is only documented indirectly (by inference): Clip Script Help -- Executing Programs -- ^!CommandLine ... unless it represents a Clip
        Message 3 of 10 , Apr 27, 2010
        • 0 Attachment
          As far as I know, this is only documented indirectly (by inference):

          Clip Script Help --> Executing Programs --> ^!CommandLine
          "... unless it represents a Clip command ..."


          Eb


          --- In ntb-clips@yahoogroups.com, loro <tabbie@...> wrote:
          >
          > ebbtidalflats wrote:
          > >^!Set %var%=If ^%index%=2 END else SOMETHING
          > >
          > >THEN you can execute the variable content with
          > >
          > >^!^%var%
          >
          > I always forget about that. I have feeling it's documented somewhere,
          > but I don't find it. Do you know where?
          >
          > Lotta
          >
        • ebbtidalflats
          Sheri, Using variable containing function names does NOT work - directly. A workaround exists, undocumented, where you assign the function name to a variable,
          Message 4 of 10 , Apr 27, 2010
          • 0 Attachment
            Sheri,

            Using variable containing function names does NOT work - directly.
            A workaround exists, undocumented, where you assign the function name to a variable, and pass it to a translator function.
            I would not rely on the workaround too much, as future versions of NoteTab may break it.

            Here is a SIMPLE example (2 clips):

            H="_UDF_Translator"
            ;UDF = User-defined function
            ^!Result ^$^&$

            H="DynamicFunctionNameCall"
            ;assign an (unknown-at-design-time function) to a variable
            ^!Set %var%=GetRow
            ;evaluate the unknown function (GetRow in this example)
            ^!Set %out%=^$UDF_Translator(GetRow)$
            ^!Info ^%out%


            This technique can of course be combined with the commandline variable technique. Now if NoteTab would only support _recursive_ clip calls <g>! Oh, and a Get and Set function for each and every configuration option NoteTab offers. Hey Eric ...


            Cheers,


            Eb


            --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
            >
            > --- In ntb-clips@yahoogroups.com, "ebbtidalflats" <ebbtidalflats@> wrote:
            > > ...
            >
            > I had problems doing that with an older versions, where there were functions in use as command parameters for the variable command. Even reported it at the time. But it does seem to be working now in a few simple tests. Maybe something has changed :D
            >
            > Regards,
            > Sheri
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.