Re: [Clip] Go to character
- 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
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 userobviously
> 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
--- In firstname.lastname@example.org, "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:
- 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
--- In email@example.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
> at strategic points in the clip just make it look nicer, other times
> keeping it off speeds thing up quite a lot.
> Have fun,
> PS, if you want to use disk search to search to the very end of a unix
> file, you can run this regex pattern: