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

23489Re: [Clip] Re: Would like better way to increment filename by one

Expand Messages
  • Ian NTnerd
    Dec 6, 2012
      On 7/12/2012 3:58 AM, joy8388608 wrote:
      > I usually use farclips instead of functions since I can call them from
      > any library. The calling clip sets a variable and the result(s) are
      > passed back in another variable.

      Your clip gots rid of the Loop I used with this RegEx. So it is faster.
      ^!Set %INFN_StartPos_Trailing_Digits%=^$StrPos("\d+$";"^%INFN_JUSTFN%";R)$

      I like that.

      You mentioned you use farclips rather than functions. I have sometimes
      used a local function called farfunc, so I get the convenience of a
      function (used inline), and the re-usability of a far clip. You have to
      modify your far clips to give the result in the variable ^%outvalue%

      ; FarFunc can call some functions in another clipbook
      ; expected parameter: farlibrary:farclip;param1;param2;paramX

      ; assign the input to a variable
      ^!set %input%=^&

      ; make an array of the input
      ^!setlistdelimiter ;
      ^!setarray %part%=^%input%

      ; Get just the parameters by removing the farlibrary and the farclip part
      ^!set %param%=^$StrReplace("^%part1%;";"";"^%input%";No;No)$

      ; call the far clip
      ^!farclip "^%part1%" ^%param%

      ; return the result
      ^!result ^%outvalue%

      That may make your basic code look more elegant.

    • Show all 13 messages in this topic