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

23874RE: [Clip] Help with variables

Expand Messages
  • John Shotsky
    Jun 10, 2013
    • 0 Attachment
      I can't use a wizard, there are literally hundreds of places these variables are used. All I'm trying to do is get the intelligence
      into the variable, so I don't have to type it into each use. I want to just use the variable, without having to type a bunch of
      qualifiers around them each time they are used. When my tool runs, there are no wizards popping up or other info type dialogs. It
      just runs to completion.

      It's bad enough that I have to go through my whole 1.5M library and replace all my current variable usages with the new variable
      names and without the qualifiers�there are sometimes three variables used in one clip. Originally, I didn't even use variables, and
      had to remember to type in each group using alternation. Then I got half-way smart and switched to variables. Now, I want smart
      variables, again cutting down on typing.

      Here is one current line: Don't worry about what it does, it just shows usage of variables.
      ^!Replace "([\d\.~]+[- ])(^%MetricUnits%) \(?([\d\.~]+[- ])(^%SUnits%)(s)?\b\)?" >> "$3$4$5 ($1$2)" ARSW
      With the new variable usage, it will be:
      ^!Replace "([\d\.~]+[- ])(^%MetricUnits%) \(?([\d\.~]+[- ])(^%Units%)\)?" >> "$3$4 ($1$2)" ARSW
      It might not look like a lot of improvement, but multiply it by hundreds of times, and it becomes more significant. Not having to
      remember the 's' and the '\b' makes it much easier to write and understand, too.

      Road kill�.funny. But I do handle pet food recipes� J

      RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/
      John's Mags Yahoo Group: <http://groups.yahoo.com/group/johnsmags/> http://groups.yahoo.com/group/johnsmags/

      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Eb
      Sent: Monday, June 10, 2013 15:18
      To: ntb-clips@yahoogroups.com
      Subject: Re: [Clip] Help with variables


      If you use a wizard to establish quantity, you could simply set a variable to contain nothing (single), an s (multiple), or 's?':

      ;inside the loop:
      ^!Set %Q%=^?{Process==singles^=|Multiples^=s|Both^=s?}
      ^!Replace "(^%animal%^%Q%\b)" >> "*$1*" RWAIS

      I don't know if the wizard will handle the '?' properly.

      By the way, "cat|rat|dog" ?! Are you working on recipies for roadkill <grin>?



      --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> , "John Shotsky" <jshotsky@...> wrote:
      > Thanks for the ideas but�

      [Non-text portions of this message have been removed]
    • Show all 12 messages in this topic