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

Re: [Clip] Go to character

Expand Messages
  • dracorat
    Wow, this was a REALLY valuable follow up message. Thanks! Also, Sheri and others, thanks for your chiming in too. I have read ahead of this message and just
    Message 1 of 38 , Jan 17, 2008
    • 0 Attachment
      Wow, this was a REALLY valuable follow up message. Thanks!

      Also, Sheri and others, thanks for your chiming in too. I have read
      ahead of this message and just completely appreciate what everyone has
      done with this.

      Now, to answer your questions:
      I am moving position by position as I didn't know how to evaluate only
      \n without \r - by any other method. I will look in to the regular
      expressions because it occurs to me I might be able (if it's
      supported) to use a regular expression to calculate how many are in a
      given selection of text. Thanks for the suggestion to turn off screen
      updating!

      I thought about dumping line feeds as well (a common SQL trick) but I
      can sometimes be dealing with 80 MB+ XML files (hence why this feature
      is so important to me). Thus, it was QUICKLY thrown out. =)

      > Why Terminus after an error? Go back and re-prompt. The user
      obviously
      > made a mistake.

      Actually, I saw no way to exit out in the event the user realizes they
      shouldn't be scanning the document or don't know where to scan to, or
      simply misclicked the wrong clip (and ran mine). As a programmer, I
      have a habit of letting users get out. The other way would require
      that they enter something. (Difference of programming philosophy I
      guess you could say.)

      I figured if they entered an invalid entry it'd be easy enough for
      them to run the clip again.

      And thanks for pointing out Dec. Woot!

      The visually-busy appearance of the clips, with their use of ^, !, "
      and % quite often had me lost for a long time. I was a bit exasperated
      as well because I needed the character count in short order.
      Eventually, I wrote an XML parser in C# that spit out XML validation
      errors that night, but being able to seek to the proper index in NTP
      will square me away.

      Thanks again for EVERYONE's participation. It's been a wonderful
      experience!

      --Keith




      --- In ntb-clips@yahoogroups.com, "Don - HtmlFixIt.com" <don@...> wrote:
      >
      > Obviously a quick study!
      > The error I guess is that I treated the line feed sequence \r\n as zero
      > when it should be one. That is very easy to fix in my recursive clip
      > where we started. When I used this line:
      > ^!Set %position%="^$Calc((^%linestop%-^%linestart%)*2)$"
      >
      > You just drop the times 2 (*2) and I think it will work just fine. But
      > you can make it more complicated if you want :-P
      > I guess I figured that a line feed was not a character when in fact it
      > is. So try this line in the original clip.
      > ^!Set %position%="^$Calc(^%linestop%-^%linestart%)$"
      >
      > A couple of comments:
    • dracorat
      Actually, what I m saying is if you were to tab to another program, then screen updating turns back on. That s the part that seems strange to me. --Keith ...
      Message 38 of 38 , Jan 28, 2008
      • 0 Attachment
        Actually, what I'm saying is if you were to tab to another program,
        then screen updating turns back on. That's the part that seems strange
        to me.

        --Keith

        --- In ntb-clips@yahoogroups.com, Sheri <silvermoonwoman@...> wrote:

        > I know that screen updating resumes when a clip ends, even if not
        > explicitly set back on. But the screen also updates when prompts and
        > clip wizards are displayed. Sometimes turning screen updating off
        and on
        > at strategic points in the clip just make it look nicer, other times
        > keeping it off speeds thing up quite a lot.
        >
        > Have fun,
        > Sheri
        >
        > PS, if you want to use disk search to search to the very end of a unix
        > file, you can run this regex pattern:
        > (*ANYCRLF)\z
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.