Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

ntb-clips · The NoteTab Clips List

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 14974 - 15003 of 23787   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#14974 From: "Don - htmlfixit.com" <don@...>
Date: Thu Apr 13, 2006 7:10 pm
Subject: Re: [Clip] Understanding Writing Subroutines
dpasseng
Send Email Send Email
 
>>When calling the custom function (or sub-routine) you do not need to
>>use the ^!Clip command (even though you are calling a clip). When
>>NoteTab does not recognise the function name ^$m2y()$ it looks for a
>>clip m2y in your current library and starts it.

I think that to be bad form even if functional as using the command
makes it clearer what you are doing.  It also has a much greater
probability of working over time should they later make an update to the
software as they almost always have reverse engineered commands and
functions.

#14975 From: "abairheart" <abairheart@...>
Date: Thu Apr 13, 2006 8:00 pm
Subject: Re: Process variable versus document ^!Replace
abairheart
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, Bob Gorman <bgorman@...> wrote:
>
> Don & Alan,
>
> Thank you both.
> I knew I could as you both suggest create a new document and do the
work
> there, but it just seemed like there might be a more elegant way.


I'm not sure what NoteTab versions y'all are using, but Pro has a
string repace function, which will search the string for a substring,
and replace it. You CAN use a variable for each of these arguments:

^$StrReplace("long string";"short string";"very long string";0;0)$

I.e.

^!Set %VLS%=Very long string
^!Set %ls%=long string; %ss%=short string
^!Set %VLS%=^$StrReplace("^%ls%";"^%ss%";"^%vls%";0;0)$
^!Info ^%vls%

Abair

#14976 From: Alan_C <acummingsus@...>
Date: Thu Apr 13, 2006 9:10 pm
Subject: Re: [Clip] Understanding Writing Subroutines
acummingsus
Send Email Send Email
 
On Thursday 13 April 2006 12:10, Don - htmlfixit.com wrote:
> >>When calling the custom function (or sub-routine) you do not need to
> >>use the ^!Clip command (even though you are calling a clip). When
> >>NoteTab does not recognise the function name ^$m2y()$ it looks for a
> >>clip m2y in your current library and starts it.
>
> I think that to be bad form even if functional as using the command
> makes it clearer what you are doing.  It also has a much greater
> probability of working over time should they later make an update to the
> software as they almost always have reverse engineered commands and
> functions.

FWIW though, a (called, child) clip written by Fookes software calls (the
child clip in turn then calls/uses) a custom function does so not via clip
but via function name:

H="_BuildScript"
^!Set %Index%=0
^!Set %Count%=^%FieldNames0%

:StartLoop
^!Inc %Index%
^!If ^%Index% > ^%Count% EndLoop
^!Set %FieldName%=^%FieldNames^%Index%%
^!IfTrue ^$IsEmpty(^%FieldName%)$ StartLoop
^!Set ^%FieldName%=^$GetXmlField(^%FieldName%)$

                                           ^^^^^^

^$GetXmlField()$

http://www.google.com/search?q=site%3Anotetab.com+xml&start=0&ie=utf-8&oe=utf-8&\
client=firefox-a&rls=org.mozilla:en-US:official

http://www.notetab.com/pad/index.htm

That particular (sub routine) clip is near the bottom of PAD.clb
-------------------

Earlier, I'd overlooked the possibility of custom function.

I never got much into custom function.  I long since learned enough of Perl
which happens to integrate well/nicely with Notetab.

Learning curve for Perl (EZ stuff is EZ, happens quick in Perl) but to get to
intermediate to advanced I found learn curve higher and longer than NTB clip.

But I find that Perl uses way less code than clip.  And (after some Perl
experience) I find Perl significantly easier to track/follow/decipher than
clip (for example, the PAD.clb to track/follow *understand* what makes it
tick, how it does what it does) (decipher, key, *access* myself *into* it).

Idiomatic Perl.  get to know it and then now I got it.  A *very* expressive
language -- so much so that some do not like it because of the height of its
expressivenes.  I experience Perl as fun!

But this is me.  I've no idea if it's consensus of others or not.  (obviously
one needs to Perl in order to comment).

So I (for myself) just write a Perl script/clip rather than a NTB custom
function.

And I didn't see a prob with:

; 4 speed and not see it happen
^!SetScreenUpdate OFF
^!Toolbar "new document"
; dump var's content to doc here
^!Find
^!Replace
; etc.
^!select ALL
; back into var
^!Set %my_var%(get_selection)
; close discard doc here
; got what I wanted done onto my var's content

Notetab lets us choose.  We each get to do it how chosen.  No prob with that!
Must be good news!

And a custom function only needs Notetab, not needs perl installed in the case
of sharing clip library with other Notetab users.

--
Alan.

#14977 From: "Bob McAllister" <fortiter@...>
Date: Fri Apr 14, 2006 2:25 am
Subject: Re: [Clip] Understanding Writing Subroutines
bob_mcallister
Send Email Send Email
 
On 4/14/06, Don - htmlfixit.com <don@...> wrote:

> I think that to be bad form even if functional as using the command
> makes it clearer what you are doing.  It also has a much greater
> probability of working over time should they later make an update to the
> software as they almost always have reverse engineered commands and
> functions.
>

Don

I guess that you could argue it to be "bad form" in some abstract
computer science sense, but it does happen to be how Eric wrote
NoteTab. Have a look at the Custom Functions page in Clip Help where
it is described as "an approach similar to the ^!Clip command".

As (the other) Bob found, trying to stick a ^!Clip command in front of
a custom function, such as ^$m2y()$, is redundant and the resulting
code just does not work.

You can call the clip m2y with ^!Clip m2y (which I infer to be your
preference) but lose the ability to pass a parameter, which was the
point of the whole exercise.

Bob McAllister

#14978 From: "rpdooling" <rpdooling@...>
Date: Fri Apr 14, 2006 6:35 am
Subject: Re: [Clip] Understanding Writing Subroutines
rpdooling
Send Email Send Email
 
Don, Bob, et al.

I haven't read the entire thread closely, just parts of it. But don't
you guys think you're testing the limits of clip code? We had this
discussion once before, I think.

Personally I believe that's why Eric made it so easy to call a Perl or
Gawk script, because when you start wanting to do things like pass
variables or do sophisticated regex you're probably better off just
biting the bullet and learning a little Perl or Python or any of the
other scripting languages you can call from within NoteTab.

Just one man's opinion.

rpd

--- In ntb-clips@yahoogroups.com, "Bob McAllister" <fortiter@...> wrote:
>
> On 4/14/06, Don - htmlfixit.com <don@...> wrote:
>
> > I think that to be bad form even if functional as using the command
> > makes it clearer what you are doing.  It also has a much greater
> > probability of working over time should they later make an update
to the
> > software as they almost always have reverse engineered commands and
> > functions.
> >
>
> Don
>
> I guess that you could argue it to be "bad form" in some abstract
> computer science sense, but it does happen to be how Eric wrote
> NoteTab. Have a look at the Custom Functions page in Clip Help where
> it is described as "an approach similar to the ^!Clip command".
>
> As (the other) Bob found, trying to stick a ^!Clip command in front of
> a custom function, such as ^$m2y()$, is redundant and the resulting
> code just does not work.
>
> You can call the clip m2y with ^!Clip m2y (which I infer to be your
> preference) but lose the ability to pass a parameter, which was the
> point of the whole exercise.
>
> Bob McAllister
>

#14979 From: "Don - htmlfixit.com" <don@...>
Date: Sat Apr 15, 2006 3:48 am
Subject: Re: [Clip] Understanding Writing Subroutines
dpasseng
Send Email Send Email
 
sombody wrote;
> But don't
> you guys think you're testing the limits of clip code?

And here I thought you were a smart person???
The Answer: Of course not, clip code has no limits ... only limits on
how you can get it to do it ... not whether it can do it.

But more seriously, I would say no for the following reasons:
1. I often and regularly write clips for other people for fun and/or
very modest profit ... and they often don't have perl/gawk/etc. so I
would have to get them to where I am with a language installed locally
instead of just writing the clip.

2. I often write a clip and email it to someone when I will be helping
that someone else.  I then only need to install notetab light on their
computer and run the clip ... same point, I haven't cluttered up their
computer with a program they won't later use (cause they will use
notetab but not perl later).

3. Why do it the easy way when the very reason I compute is for the
challenge of it?  To me this is like doing jigsaw puzzles.  It keeps me
sharper than I might otherwise be (don't even ponder how dense that
might be).

4. There often is a better tool to do job a OR b OR c, but seldom one
that can do a AND b AND c ... but notetab can.

I have taken to writing subroutines (if that is what we will call them)
after our prior discussions unlocked the concept a little further.  I
have come to find them very handy.  I will pass parameters by using a
two line call:
line one sets the variables that will be used in the subroutine
and line two calls the subroutine that then has those variables
available to it when it runs ...
and when I get back, the variables are essentially the returned values
because they are again available in the clip.

Because in this example the "function" to be performed in the subroutine
is a one liner, there is no advantage to the subroutine, but if the
subroutine is a 30 line thing ... well then yes it would be worth it if
reused.

I also find it a great way to write portable bits of code.  For example
I wrote one to adjust back and forth between light and pro for the
replace line feed situation (that I call a bug).  I have used the same
subroutine to correct that in several clips now by calling it as a
subroutine clip.

Thems my thoughts on it.

D

#14980 From: "Don - htmlfixit.com" <don@...>
Date: Sat Apr 15, 2006 10:06 pm
Subject: Re: [Clip] Understanding Writing Subroutines
dpasseng
Send Email Send Email
 
Bob McAllister wrote:
> I guess that you could argue it to be "bad form" in some abstract
> computer science sense, but it does happen to be how Eric wrote
> NoteTab. Have a look at the Custom Functions page in Clip Help where
> it is described as "an approach similar to the ^!Clip command".
>
I didn't realize that this was a custom function.  I guess you are
correct and that won't go away.  I also see what you say about passing a
parameter.

It appears that the only way to pass a parameter is the highlight the
"parameter" so the parameter must be in your text document?  I remember
trying to understand these a while back and thinking that it wasn't
worth the effort.  Here is how I have taken to using "subroutines" and
as you see I am using an array to pass the parameters.

H="first letter"
;set variables to be passed as parameters
^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
;call "subroutine"
^!Clip "grabfirstletters"
^!SetArray %items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
;call "subroutine"
^!Clip "grabfirstletters"


H="_grabfirstletters"
^!Set %count%=1;%string%=""
:Loop
^!Set %string%=^%string%^$StrCopyLeft("^%items^%count%%";1)$
^!Inc %count%
^!If ^%count% <= ^%items0% Loop
^!InsertText ^%string% = ^%items%^P

#14981 From: "rpdooling" <rpdooling@...>
Date: Sun Apr 16, 2006 5:40 am
Subject: Re: Understanding Writing Subroutines
rpdooling
Send Email Send Email
 
All I'm saying is, why not have NoteTab run a single Python script
that fits on two lines:

t = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']
for color in t: print color[0],

>>r o y g b i v

Instead of having NoteTab run two clips worth of code:

H="first letter"
;set variables to be passed as parameters
^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
;call "subroutine"
^!Clip "grabfirstletters"
^!SetArray %items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
;call "subroutine"
^!Clip "grabfirstletters"

H="_grabfirstletters"
^!Set %count%=1;%string%=""
:Loop
^!Set %string%=^%string%^$StrCopyLeft("^%items^%count%%";1)$
^!Inc %count%
^!If ^%count% <= ^%items0% Loop
^!InsertText ^%string% = ^%items%^P

And the remark in your last post about portability was off the mark.
If you write a script in Perl or Python you can run it in NoteTab on
Windows, in Emacs on Linux, in BBedit on Mac, and so on. That's what's
commonly called "portability." A clip can only be run in NoteTab.

Hey, I love NoteTab, too, but it's main attraction is that it's
extensible far beyond clip code.

rd


--- In ntb-clips@yahoogroups.com, "Don - htmlfixit.com" <don@...> wrote:
>
> Bob McAllister wrote:
> > I guess that you could argue it to be "bad form" in some abstract
> > computer science sense, but it does happen to be how Eric wrote
> > NoteTab. Have a look at the Custom Functions page in Clip Help where
> > it is described as "an approach similar to the ^!Clip command".
> >
> I didn't realize that this was a custom function.  I guess you are
> correct and that won't go away.  I also see what you say about
passing a
> parameter.
>
> It appears that the only way to pass a parameter is the highlight the
> "parameter" so the parameter must be in your text document?  I remember
> trying to understand these a while back and thinking that it wasn't
> worth the effort.  Here is how I have taken to using "subroutines" and
> as you see I am using an array to pass the parameters.
>
> H="first letter"
> ;set variables to be passed as parameters
> ^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
> ;call "subroutine"
> ^!Clip "grabfirstletters"
> ^!SetArray
%items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
> ;call "subroutine"
> ^!Clip "grabfirstletters"
>
>
> H="_grabfirstletters"
> ^!Set %count%=1;%string%=""
> :Loop
> ^!Set %string%=^%string%^$StrCopyLeft("^%items^%count%%";1)$
> ^!Inc %count%
> ^!If ^%count% <= ^%items0% Loop
> ^!InsertText ^%string% = ^%items%^P
>

#14982 From: "rpdooling" <rpdooling@...>
Date: Sun Apr 16, 2006 5:50 am
Subject: Re: Understanding Writing Subroutines
rpdooling
Send Email Send Email
 
On second thought, it all fits on ONE LINE, even though it probably
wraps when posted:

for color in ['red', 'orange', 'yellow', 'green', 'blue', 'indigo',
'violet']: print color[0],

rpd

--- In ntb-clips@yahoogroups.com, "rpdooling" <rpdooling@...> wrote:
>
> All I'm saying is, why not have NoteTab run a single Python script
> that fits on two lines:
>
> t = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']
> for color in t: print color[0],
>
> >>r o y g b i v
>
> Instead of having NoteTab run two clips worth of code:
>
> H="first letter"
> ;set variables to be passed as parameters
> ^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
> ;call "subroutine"
> ^!Clip "grabfirstletters"
> ^!SetArray
%items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
> ;call "subroutine"
> ^!Clip "grabfirstletters"
>
> H="_grabfirstletters"
> ^!Set %count%=1;%string%=""
> :Loop
> ^!Set %string%=^%string%^$StrCopyLeft("^%items^%count%%";1)$
> ^!Inc %count%
> ^!If ^%count% <= ^%items0% Loop
> ^!InsertText ^%string% = ^%items%^P
>
> And the remark in your last post about portability was off the mark.
> If you write a script in Perl or Python you can run it in NoteTab on
> Windows, in Emacs on Linux, in BBedit on Mac, and so on. That's what's
> commonly called "portability." A clip can only be run in NoteTab.
>
> Hey, I love NoteTab, too, but it's main attraction is that it's
> extensible far beyond clip code.
>
> rd
>
>
> --- In ntb-clips@yahoogroups.com, "Don - htmlfixit.com" <don@> wrote:
> >
> > Bob McAllister wrote:
> > > I guess that you could argue it to be "bad form" in some abstract
> > > computer science sense, but it does happen to be how Eric wrote
> > > NoteTab. Have a look at the Custom Functions page in Clip Help where
> > > it is described as "an approach similar to the ^!Clip command".
> > >
> > I didn't realize that this was a custom function.  I guess you are
> > correct and that won't go away.  I also see what you say about
> passing a
> > parameter.
> >
> > It appears that the only way to pass a parameter is the highlight the
> > "parameter" so the parameter must be in your text document?  I
remember
> > trying to understand these a while back and thinking that it wasn't
> > worth the effort.  Here is how I have taken to using "subroutines"
and
> > as you see I am using an array to pass the parameters.
> >
> > H="first letter"
> > ;set variables to be passed as parameters
> > ^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
> > ;call "subroutine"
> > ^!Clip "grabfirstletters"
> > ^!SetArray
> %items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
> > ;call "subroutine"
> > ^!Clip "grabfirstletters"
> >
> >
> > H="_grabfirstletters"
> > ^!Set %count%=1;%string%=""
> > :Loop
> > ^!Set %string%=^%string%^$StrCopyLeft("^%items^%count%%";1)$
> > ^!Inc %count%
> > ^!If ^%count% <= ^%items0% Loop
> > ^!InsertText ^%string% = ^%items%^P
> >
>

#14983 From: Don Daugherty <daugherty@...>
Date: Sun Apr 16, 2006 7:50 pm
Subject: Re: [Clip] Need help with RegExpr for Find and Replace in Table attributes
dondaugherty...
Send Email Send Email
 
Wiz Feinberg wrote:

>For example, here is a table tag that I need to alter:
>
><TABLE  height="100%" cellSpacing=0 cellPadding=0 width=650
>align=center background=images/bg.gif border=0>
>
>In this instance I will need to remove the entire height attribute,
>convert the background attribute to an inline style, and add a summary
>attribute. I also want to make all attributes lowercase. The finished
>tag would be like this:
>
><table cellspacing="0" cellpadding="0" width="650" align="center"
>style="background-image:url(images/bg.gif)" border="0" summary="Layout
>table">
>
>On other tables I only need to add the summary to the end of the
>attributes.
>
>
Here are a few ideas, indicating the Clip commands you would want to
read-up on in order to automate your task.

To select the entire <table ...> tag us this:
^!Find "<table" IS
^!Select HtmlTag
Having select the tag, you can perform the requred search/replace
commands, for example
^!Replace "height=[^\s]+\s" >> "" RHIS
Notes:
1.  The R indicates the use of a regular expression.
2.  The \s stands for a space;
3.  The cryptic construction [^\s] means any character BUT the space;
4.  The + means one or more instances of the preceding character.
5.  Thus the ^!Replace command looks within the selected text for
"height=" followed immediately followed by one or more non-space
character, such as "100%", and a space, and it replaces the combination
with a null string ("").

To add a summary at the end use something like
^!Replace ">" >> "summary="whatever is appropriate">" HS

#14984 From: "Bob McAllister" <fortiter@...>
Date: Mon Apr 17, 2006 6:01 am
Subject: Re: [Clip] Understanding Writing Subroutines
bob_mcallister
Send Email Send Email
 
On 4/16/06, Don - htmlfixit.com <don@...> wrote:
> Here is how I have taken to using "subroutines" and
> as you see I am using an array to pass the parameters.
>
> H="first letter"
> ;set variables to be passed as parameters
> ^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
> ;call "subroutine"
> ^!Clip "grabfirstletters"
> ^!SetArray %items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
> ;call "subroutine"
> ^!Clip "grabfirstletters"

Don

I have modified your two clips to use custom functions as below.

H=first letter
^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
^$grabfirstletter(^%items%)$ = ^%items%^%NL%
^!SetArray %items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
^$grabfirstletter(^%items%)$ = ^%items%^%NL%

H=_grabfirstletter
^!SetArray %wordlist%=^&
^!Set %count%=1;%Result%=""
:Loop
^!Set %Result%=^%Result%^$StrCopyLeft("^%wordlist^%count%%";1)$
^!Inc %count%
^!If ^%count% <= ^%items0% Loop

The key is the use of the "special variable" %Result% in the
definition of the custom function. That will be what is returned at
the end of the sub-routine and its value printed by the top-level clip
at the point where the custom function was called.

This is a general case where the "content" of your array variable
%items% is passed to the custom function (as ^&) and placed into a new
variable. It works regardless of the source of the passed parameter.

In your situation where tou already know the name of the variable
holding the data on which the function is to operate, I can
short-circuit by using that same variable in the custom function (and
so effectively pass an empty parameter).

The following clips implement that special case relying on knowing the
variable name in calling routine.
H=flspecialcase
^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
^$grabfirstletterx()$ = ^%items%^%NL%
^!SetArray %items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
^$grabfirstletterx()$ = ^%items%^%NL%

H=_grabfirstletterx
^!Set %count%=1;%Result%=""
:Loop
^!Set %Result%=^%Result%^$StrCopyLeft("^%items^%count%%";1)$
^!Inc %count%
^!If ^%count% <= ^%items0% Loop

There may be circumstances where you prefer this method.

Bob

#14985 From: "rpdooling" <rpdooling@...>
Date: Tue Apr 18, 2006 4:14 am
Subject: Re: Understanding Writing Subroutines
rpdooling
Send Email Send Email
 
Bob,

>> ^$grabfirstletter(^%items%)$ = ^%items%^%NL%

I have never seen that. That IS a nifty trick.

Rick


H=first letter
^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
^$grabfirstletter(^%items%)$ = ^%items%^%NL%
^!SetArray %items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
^$grabfirstletter(^%items%)$ = ^%items%^%NL%

H=_grabfirstletter
^!SetArray %wordlist%=^&
^!Set %count%=1;%Result%=""
:Loop
^!Set %Result%=^%Result%^$StrCopyLeft("^%wordlist^%count%%";1)$
^!Inc %count%
^!If ^%count% <= ^%items0% Loop

--- In ntb-clips@yahoogroups.com, "Bob McAllister" <fortiter@...> wrote:
>
> On 4/16/06, Don - htmlfixit.com <don@...> wrote:
> > Here is how I have taken to using "subroutines" and
> > as you see I am using an array to pass the parameters.
> >
> > H="first letter"
> > ;set variables to be passed as parameters
> > ^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
> > ;call "subroutine"
> > ^!Clip "grabfirstletters"
> > ^!SetArray
%items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
> > ;call "subroutine"
> > ^!Clip "grabfirstletters"
>
> Don
>
> I have modified your two clips to use custom functions as below.
>
> H=first letter
> ^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
> ^$grabfirstletter(^%items%)$ = ^%items%^%NL%
> ^!SetArray
%items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
> ^$grabfirstletter(^%items%)$ = ^%items%^%NL%
>
> H=_grabfirstletter
> ^!SetArray %wordlist%=^&
> ^!Set %count%=1;%Result%=""
> :Loop
> ^!Set %Result%=^%Result%^$StrCopyLeft("^%wordlist^%count%%";1)$
> ^!Inc %count%
> ^!If ^%count% <= ^%items0% Loop
>
> The key is the use of the "special variable" %Result% in the
> definition of the custom function. That will be what is returned at
> the end of the sub-routine and its value printed by the top-level clip
> at the point where the custom function was called.
>
> This is a general case where the "content" of your array variable
> %items% is passed to the custom function (as ^&) and placed into a new
> variable. It works regardless of the source of the passed parameter.
>
> In your situation where tou already know the name of the variable
> holding the data on which the function is to operate, I can
> short-circuit by using that same variable in the custom function (and
> so effectively pass an empty parameter).
>
> The following clips implement that special case relying on knowing the
> variable name in calling routine.
> H=flspecialcase
> ^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
> ^$grabfirstletterx()$ = ^%items%^%NL%
> ^!SetArray
%items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
> ^$grabfirstletterx()$ = ^%items%^%NL%
>
> H=_grabfirstletterx
> ^!Set %count%=1;%Result%=""
> :Loop
> ^!Set %Result%=^%Result%^$StrCopyLeft("^%items^%count%%";1)$
> ^!Inc %count%
> ^!If ^%count% <= ^%items0% Loop
>
> There may be circumstances where you prefer this method.
>
> Bob
>

#14986 From: "dave" <dmc43959@...>
Date: Thu Apr 20, 2006 2:48 pm
Subject: need for a otl clip
david_99_au
Send Email Send Email
 
Hi
I was thinking do not know quite how to go about this with otl,s I have a
need for a  back clip along the lines of ,if your moving forward and back
,each time I  land on a topic it is stored in a variable so you end up with
say six stored topics so when you want to go back all you have to do is to
click on back clip this brings up list and the topic you want to go back to
is there ?

     THANKYOU  DAVE  M

#14987 From: Alan_C <acummingsus@...>
Date: Thu Apr 20, 2006 6:19 pm
Subject: Re: [Clip] need for a otl clip
acummingsus
Send Email Send Email
 
Hi,

I vaguely remember writing a clip and sharing it to this list.  It may use
less stored memories than you seek.  But it ability somewhat to go forward
and back.

It was near 2 to 4 years ago.  If to search the group archives.  Alan, Alan C,
or Alan_C

I'd share the clip direct, now.  But it must be in an old backup on cd that's
misplaced somewhere until I find it.  Alan.

On Thursday 20 April 2006 07:48, dave wrote:
> Hi
> I was thinking do not know quite how to go about this with otl,s I have a
> need for a  back clip along the lines of ,if your moving forward and back
> ,each time I  land on a topic it is stored in a variable so you end up with
> say six stored topics so when you want to go back all you have to do is to
> click on back clip this brings up list and the topic you want to go back to
> is there ?

#14988 From: Bill Harriff <bhc@...>
Date: Fri Apr 21, 2006 6:16 am
Subject: Parsing & massaging data files...
bhc@...
Send Email Send Email
 
I need to parse a plain text data file that has no separators except
for the layout of the data. Here's how each record is laid out IF all
fields have entries:
Line 1, chars 1-12 (last name); chars 13-21 (first name);
   chars 22-26 (mid initial); chars 27-48 (address 1); chars 49-62
   (city); chars 63-64 (State)<return>
Line 2, chars 1-67 (empty spaces); chars 68-74 (zipcode); chars
   75-87 (phone #); chars 88-97 (dob in mm/dd/yyyy format)<return>
Line 3, chars 1-12 (SSN).

If data is missing then the <returns> may occur at different,
inconsistent points and the line length may be a different
length that a fully populated record (e.g., see the 1st record
below for John Sample that is missing 7 or the 10 fields). I do get
3 lines for each record even if fields are missing.


Here are 5 sample records with different fields missing from 3 and
complete data for 2. This is the before view (be sure to turn off word
wrap):

SAMPLE     JOHN

    (503)321-7654

BALLSTON   ANN           135 SAINT ST.         TIGARD       OR
                                                                    97111
   (503)666-1111111/21/1950
111-22-3333
Smith      JOHN     A    1245 E. Smith DR.     Portland      OR
                                                                    97333
   (503)987-654305/09/1960
999-88-7777
JOHNSON    PAUL     E    375 VANCOUVER ST #3   PORTLAND      OR
                                                                    97222
                07/05/1983
666-55-1212
BUSH   HERATIO           747 SKYWAY LANE       VANCOUVER     WA
                                                                    97666
   (701)410-1235
345-67-8900

Here is what I want to get it to (notice the substitutions for missing
data):

"LastName","FirstName","MI","Address 1","City","ST","Zipcode","Phone
#","DOB","SSN"
"SAMPLE","JOHN","z","unknown","unknown","XX","00000","(503)321-7654","00/00/1900\
","000-00-0000"
"BALLSTON","ANN","z","135 SAINT
ST.","TIGARD","OR","97111","(503)666-11111","11/21/1950","111-22-3333"
"Smith","JOHN","A","1245 E. Smith
DR.","Portland","OR","97333","(503)987-6543","05/09/1960","999-88-7777"
"JOHNSON","PAUL","E","375 VANCOUVER ST
#3","PORTLAND","OR","97222","(000)000-0000","07/05/1983","666-55-1212"
"BUSH","HERATIO","z","747 SKYWAY
LANE","VANCOUVER","WA","97666","(701)410-1235","00/00/1900","345-67-8912"

The office mgr wants dummy values in the field because the new db vendor
says it's easier to do reports for incorrect/missing values if there are
standard dummy place holders, hence...
- "z" for a missing MI
- "97000" for a missing zipcode
- "(000)000-0000" for a missing phone #
- "00/00/1900" for a missing dob
- "000-00-0000" for a missing ssn

Note that there are records with 4 different states (OR, WA, CA, ID) and
some records don't include the state.

There are 2000 + records & so far I can't get a very clean conversion,
so I thought I'd ask about using regex to count chars and/or line
length as well as looking for patterns/missing patterns to determine
where to put the quotes & delimiters. I did a 500+ list of vendors
earlier this week & it wound up being a bad mix of auto & manual
'search & replace' and then manual reviewing of the field count,
so what should have been a 20 minute job took over 3 hrs.

I'd like to avoid that this time so I thought that maybe this was a good
time to tackle regex with some help, of course. Thanks for any help you
can provide.

Bill Harriff

#14989 From: "Steven J. Aves" <tai@...>
Date: Fri Apr 21, 2006 12:48 pm
Subject: Managing Outline Contents
sjaves
Send Email Send Email
 
I use Notetab's outline function quite extensively in my work.  I'm a
travel agent and I keep all of my current work notes, web clippings,
etc in an outline.

The Outline clip is quite helpful, but there are two functions I would
like to have:

1. Permanent bookmarks.  Is there a way to bookmark and save them with
the file?
2. Extract selected outline documents.  I need to archive completed
documents and have not found a way to select the ones I want, extract
them to another outline file, then delete them from the work file.

Any tips or clips would be greatly appreciated.

Thanks,
Steve

#14990 From: "dave" <dmc43959@...>
Date: Fri Apr 21, 2006 1:25 pm
Subject: Re: [Clip] Managing Outline Contents
david_99_au
Send Email Send Email
 
Hi
Read the readme otl that comes with notetab below is the bottom of one page
I think this is what you are after.
* To jump to a specific line number in a document, the format of the
hyperlink is similar to the search criteria. You use the line number instead
of the search text and use the parameter "L" so that NoteTab knows it is the
line number you want and not text to search. For example, [readme.txt::5^L]
will display the Readme.txt file with the cursor at the beginning of the 5th
line. If you specify "-1", the cursor will be placed on the last line:
[readme.txt::-1^L]

* URLs are also valid. However, if the link does not start with the typical
"www.", then you must fully qualify the URL (add "http://", or "ftp://",
etc.). The following will connect to the NoteTab site through your default
web browser [www.notetab.ch]. Hold the Alt key down if you want to open the
link in a new web browser window (this feature may not work with all
browsers).

[D:\NTS\readme.txt::6^L]
[D:\NTS\readme.txt::replacement]
[D:\goldwave\readme.txt::Features]
[FILE:///D:\html\bandpass.html]

     THANKYOU   DAVE  M

----- Original Message -----
From: "Steven J. Aves" <tai@...>
To: <ntb-clips@yahoogroups.com>
Sent: Friday, April 21, 2006 10:48 PM
Subject: [Clip] Managing Outline Contents


>I use Notetab's outline function quite extensively in my work.  I'm a
> travel agent and I keep all of my current work notes, web clippings,
> etc in an outline.
>
> The Outline clip is quite helpful, but there are two functions I would
> like to have:
>
> 1. Permanent bookmarks.  Is there a way to bookmark and save them with
> the file?
> 2. Extract selected outline documents.  I need to archive completed
> documents and have not found a way to select the ones I want, extract
> them to another outline file, then delete them from the work file.
>
> Any tips or clips would be greatly appreciated.
>
> Thanks,
> Steve
>
>
>
>
>
>
>
>
> Fookes Software: http://www.fookes.us, http://www.fookes.com
> Fookes Software Mailing Lists: http://www.fookes.us/maillist.htm
>
> Yahoo! Groups Links
>
>
>
>
>
>
>

#14991 From: "rpdooling" <rpdooling@...>
Date: Fri Apr 21, 2006 5:18 pm
Subject: Re: Managing Outline Contents
rpdooling
Send Email Send Email
 
It's easy to make permanent bookmarks in any form you wish {1} or
whatever. You can make clips to create them or remove them before, say
exporting to Word, or whatever.

Along the same lines, you can use the hyperlink feature of outline
docs to make a poor man's footnotes.  Place a [ 1 ] in the body of the
text where you wish to link to the footnote, then place a [ 1^B ]
where you want the footnote itself. Now doubleclicking on [ 1 ] will
take you to [ 1^B ] and doubleclicking on [ 1^B ] will take you back
to [ 1 ] from whence you came.

rick

--- In ntb-clips@yahoogroups.com, "Steven J. Aves" <tai@...> wrote:
>
> I use Notetab's outline function quite extensively in my work.  I'm a
> travel agent and I keep all of my current work notes, web clippings,
> etc in an outline.
>
> The Outline clip is quite helpful, but there are two functions I would
> like to have:
>
> 1. Permanent bookmarks.  Is there a way to bookmark and save them with
> the file?
> 2. Extract selected outline documents.  I need to archive completed
> documents and have not found a way to select the ones I want, extract
> them to another outline file, then delete them from the work file.
>
> Any tips or clips would be greatly appreciated.
>
> Thanks,
> Steve
>

#14992 From: loro <loro-spam01-@...>
Date: Fri Apr 21, 2006 6:26 pm
Subject: Offline CSS Validator for Notetab
yastupidhoo
Send Email Send Email
 
Hi,

Igor Podlubny, the author of the Offline HTML Validator and the handy
Multiple Clipboard has just released an offline CSS checker. I find this
even more useful than the HTML validator. The CSS syntax makes at least me
more prone to typos and spelling mistakes, which leads me to validate
often. All the more handy to have it built in. Small download, requires
Java, free. Check it out.

Offline CSS Validator:
<http://www.tuke.sk/podlubny/oc.html>

Lotta

#14993 From: "donaldhines" <tr6vb6z02@...>
Date: Tue Apr 25, 2006 1:57 pm
Subject: outline documents and clips
donaldhines
Send Email Send Email
 
How do I move from one outline header to another with a clip?

#14994 From: Larry Hamilton <lmh@...>
Date: Tue Apr 25, 2006 3:18 pm
Subject: Re: [Clip] outline documents and clips
lm_hamilton
Send Email Send Email
 
Donald,

There is not a clip command for navigating outline files. Those of us
who use outlines a lot are hopeful that Eric will add a couple more clip
commands to make it easier to work with outlines. However, a clip can be
made to work on outline headings.

Here is a clip I made to rename outline headers. (This clip is from
1999, there are other ways to do this now.) The Document Menu has a sub
menu for Document Headings. This clip will activate that menu ALT+D H E,
to edit the outline heading. It then uses the keyboard command for
PageUp to go to the next topic. This clip was designed to manually start
at the last heading in the outline. NOTE: This clip assumes that Show
Headings is turned off.

H="Change Header Name"
;Lawrence M. (Larry) Hamilton, Jr. - 6/15/99
;Originally developed to change the header name from system date and
time as created by the clip "Clipstor", by Lawrence R. Thomas, to the
first line of current topic. This clip uses the CONTINUE command to give
the user control over the process. A loop without this control could
make the process much faster! I found this good to use after using
Clipstore to copy several items from a program's help file. ^p^p NOTE:
Clipstore has been updated to include this feature. See:
http://www.notetab.com/libraries
:START
^!CONTINUE Change Header Name?
^!KEYBOARD END
^!SELECT BOL
^!KEYBOARD CTRL+C
^!KEYBOARD ALT+D H E CTRL+V ENTER
^!KEYBOARD PAGEUP PAGEUP
^!GOTO START

A quick search of the Clip Help shows the following Clip Commands and
Functions for working with outlines.

Outline Clip Commands & Functions:

COMMANDS:

^!AddHeading "HeadingName"
Adds a new heading to the active Outline document.

^!SetTopicIndex IndexValue
Activates the topic at the specified position in the current outline
document. First topic is 1.

^!ShowHeadings [True|False] (added in v4.52)
Shows or hides Outline heading names in the editor window.

  ^!SetFocus
[Clipbook|ClipEdit|Document|Frame1|Frame2|List_Clip|List_Disk|List_Docs|List_Fav\
s|Outline|PasteBoard]
Moves the focus to the specified screen object. This command will fail
if the NoteTab window is minimized. Example to move the focus to the
Outline-headings window:
^!SetFocus Outline

^!Jump nnn
or
^!Jump +/-nnn
or
^!Jump [LINE_START|LINE_END][SELECT_START|SELECT_END][TEXT_START|TEXT_END]
Moves cursor to the indicated position. If the parameter is a number
without a sign (+/-), the command will treat it as the line position
from the start of the document. When a sign is used, the command will
move the cursor a relative number of lines from the current position; a
positive number moving it towards the end of the text and a negative
number towards the start. If you don't specify a line number, you can
use one of the following settings:
LINE_START or LINE_END: places cursor at the beginning or end of the
current line. This feature treats a line as if word wrap is turned off.
SELECT_START or SELECT_END: places cursor at the beginning or end of the
selection and unselects the text.
TEXT_START or TEXT_END: moves to start or end of a plain document or the
content of an Outline heading.
DOC_START or DOC_END: moves to start or end of any kind of document.

FUNCTIONS:

^$IsOutlineDoc$
Returns 1 if current document is Outline type document, or 0 if it is not.

^$IsShowHeadings$ (added in v4.52)
Returns 1 if headings are displayed in the outline document window and 0
if they are not.

^$GetTopicIndex$
^$GetTopicIndex(Name)$ (added in v4.51)
Returns the index position of current outline topic. Use the optional
Name parameter to find the index position of another topic.

^$GetTopicName$
^$GetTopicName(Index)$ (added in v4.52)
Returns the current outline heading name, if no index is specified, or
the heading name at specified index position. An invalid index number
returns an empty string. The first heading is index 1.

Larry Hamilton
Kairos Computer Solutions
http://www.kairoscomputers.com/
Sales Affiliate for Grisoft Anti-Virus

donaldhines wrote:
> How do I move from one outline header to another with a clip?

#14995 From: "abairheart" <abairheart@...>
Date: Tue Apr 25, 2006 5:23 pm
Subject: Re: [Clip] outline documents and clips
abairheart
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, Larry Hamilton <lmh@...> wrote:

> ^$IsOutlineDoc$
> ^$GetTopicIndex(Name)$ (added in v4.51)
> ^$GetTopicName(Index)$ (added in v4.52)
>
> donaldhines wrote:
> > How do I move from one outline header to another with a clip?
>


On a quick scan I did not see ^$GetTopicCount$.

with it and the above commands you can build your own
clip to collect all outline headers into an array,
which you can then use to access any heading using
the

^!SetTopicIndex IndexValue

command.

Something like:
^!Set %x%=1
^!SetArray %headers%=^$GetTopicName(^%x%)$;^%headers%
^!Inc %x%
^!If ^%x%<=^$GetTopicCount$ SKIP_-2

The only thing remaining is to write a clip using that
array to switch outline headers.


Abair

#14996 From: "Bryan Falk" <bryanfalk@...>
Date: Thu Apr 27, 2006 4:11 pm
Subject: removing spaces and periods in a document
bryanfalk
Send Email Send Email
 
I need to remove all spaces and periods in a document every day.  I can
do this in excel via a macro, and was hoping that the clip library
would also be able to replace something with nothing, so to speak.  Any
ideas how to do this?

#14997 From: "abairheart" <abairheart@...>
Date: Thu Apr 27, 2006 8:19 pm
Subject: Re: removing spaces and periods in a document
abairheart
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, "Bryan Falk" <bryanfalk@...> wrote:
>
> I need to remove all spaces and periods in a document every day.  I can
> do this in excel via a macro, and was hoping that the clip library
> would also be able to replace something with nothing, so to speak.  Any
> ideas how to do this?
>

From  the menu, search-->replace, enter your search target,
leave replace target blank

In a clip, you can use a similar technique for the Replace command,
just use a double delimiter between the target string and the modifiers
at the end of the line.

If you use StrReplace function, just use a double quote for the
replace string (nothing between the quotes.



Abair

#14998 From: hsavage <hsavage@...>
Date: Thu Apr 27, 2006 11:57 pm
Subject: Re: [Clip] Re: removing spaces and periods in a document
hrs62930
Send Email Send Email
 
abairheart wrote:
  > --- In ntb-clips@yahoogroups.com, "Bryan Falk" <bryanfalk@...> wrote:
  >> I need to remove all spaces and periods in a document every day.  I can
  >> do this in excel via a macro, and was hoping that the clip library
  >> would also be able to replace something with nothing, so to speak.  Any
  >> ideas how to do this?
  >>
  >
  >> From  the menu, search-->replace, enter your search target,
  > leave replace target blank
  >
  > In a clip, you can use a similar technique for the Replace command,
  > just use a double delimiter between the target string and the modifiers
  > at the end of the line.
  >
  > If you use StrReplace function, just use a double quote for the
  > replace string (nothing between the quotes.
  >
  >
  >
  > Abair

Bryan,

Here's a short 1 working line clip to do what you seek.

H="Remove spaces-periods"
; load/focus file to work on.
; run this clip.
^!Replace "(\.)|(\s)" >> "" TIWHRSA

  ºvº
  06.04.27_18.23
  -Newspaper HeadLine...
  "Local High School Dropouts Cut in Half"
  hrs ø hsavage@...

#14999 From: "Sheri" <silvermoonwoman@...>
Date: Sun Apr 30, 2006 12:55 pm
Subject: Re: outline documents and clips
silvermoonwo...
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, "donaldhines" <tr6vb6z02@...> wrote:
>
> How do I move from one outline header to another with a clip?

You can get next, previous, first and last topic using ^!Menu commands.

e.g.,

^!Menu Document/Outline Headings/Move Next

Regards,
Sheri

#15000 From: "Sheri" <silvermoonwoman@...>
Date: Sun Apr 30, 2006 1:26 pm
Subject: Accessing outline topics
silvermoonwo...
Send Email Send Email
 
I saw a few recent messages about clips and outlines. Just thought I
would mention that there is a clip in my Clipcode Syntax package for
accessing topics in outlines (also works for accessing clips in clip
libraries or clipbars). It gives a several options for what to do
with the outline text (such as display it or enter it into the
current document; if its a clip from a clip library or clipbar you
can run it).

If you leave the keyword string blank it will let you choose from all
of the selected file's topics (or clips). Otherwise you can enter
something from the desired header as a keyword, and then choose from
the headers that include that text (if there was more than one).

http://groups.yahoo.com/group/ntb-clips/files/ClipcodeSyntax_v4.02.zip

The clip is called "Retrieve Clip or Topic".

The clips are in a replacement file for cliphelp.clh (one of the
files found in Notetab's main directory (make a backup of your
original). Read the instructions to make sure you install it and the
other files (including a clip library, clipbar, and outline file)
correctly.

Another of the included clips, "ClipCode Syntax 4.02" helps you write
correctly formatted clip commands. Again, be sure to read the
instructions.

Regards,
Sheri

#15001 From: "essinger2001" <Dilbernator@...>
Date: Sun Apr 30, 2006 5:07 pm
Subject: Clip or Script to strip headings from a file
essinger2001
Send Email Send Email
 
I'm new to the clip programming, and want to learn.  I need to process
a file that has headings I need to cut.  What I am doing now that I
would like to automate is finding the date in the first heading, then
selecting all of that line, and the following 6 or 7 lines (don't
remember at this point).  After deleting the selected lines, I repeat
the find, select the next lines, delete, repeat 20 or 30 times.  Time
consuming and boring by hand - subject to errors as well.

Can someone point out to me the commands to do such a thing in a clip,
or a script?

Thanks!

Jim

#15002 From: "Sheri" <silvermoonwoman@...>
Date: Sun Apr 30, 2006 6:33 pm
Subject: Re: Clip or Script to strip headings from a file
silvermoonwo...
Send Email Send Email
 
Hi Jim,

Here's something to help get you started. The !Setdebug helps you see
what your clip is doing (until it does what you need). As is, this clip
will find "2006", select 7 lines including the one the 2006 is on, and
delete those lines. You can copy the following lines to the clipboard,
and then add them as a new clip to your clip library by right clicking
in your clip panel and selecting "Add from Clipboard."

Another possible approach would be to do the task using a regular
expression to replace matching lines (with empty text) either using the
Search and Replace dialog or a clip with a single ^!Replace command.

Aside from the ^!Setdebug command, it is useful to know that comments
start with a semicolon, and to stop a runaway clip you press Ctrl+Alt.

Have fun,
Sheri

H="userdelheads"
^!Setdebug on
:LoopStart
^!Find "2006" TS
^!Iferror End
^!Jump Select_Start
^!Select 7
;Next command picks up carriage return/line feed on the last line
^!Select +2
^!Menu Edit/Cut
^!Goto LoopStart
:EndLoop
;end of clip



--- In ntb-clips@yahoogroups.com <mailto:ntb-clips@yahoogroups.com> ,
"essinger2001" <Dilbernator@...> wrote:
>
> I'm new to the clip programming, and want to learn.  I need to process
> a file that has headings I need to cut.  What I am doing now that I
> would like to automate is finding the date in the first heading, then
> selecting all of that line, and the following 6 or 7 lines (don't
> remember at this point).  After deleting the selected lines, I repeat
> the find, select the next lines, delete, repeat 20 or 30 times.  Time
> consuming and boring by hand - subject to errors as well.
>
> Can someone point out to me the commands to do such a thing in a clip,
> or a script?
>
> Thanks!
>
> Jim
>

>




[Non-text portions of this message have been removed]

#15003 From: "essinger2001" <Dilbernator@...>
Date: Mon May 1, 2006 6:57 am
Subject: Re: Clip or Script to strip headings from a file
essinger2001
Send Email Send Email
 
Hi Sheri,

Thanks for the sample code.  It works great - I have adapted it to
change all spaces to a single space, Strip the ending blanks, and
replace remaining spaces with commas.  What I get is a report that
should be spreadsheet (can't get them to send in the needed format,
just the report), and I am getting it to a CSV file to import it to a
spreadsheet.  I would like to prompt for the replacement value as the
form of the date is mm/dd/yy, and changes with each sending of the
report.  I am not understanding the prompting for variables at run
time.  Any help?

Thanks again!

Jim

--- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
>
>
> Hi Jim,
>
> Here's something to help get you started. The !Setdebug helps you see
> what your clip is doing (until it does what you need). As is, this clip
> will find "2006", select 7 lines including the one the 2006 is on, and
> delete those lines. You can copy the following lines to the clipboard,
> and then add them as a new clip to your clip library by right clicking
> in your clip panel and selecting "Add from Clipboard."
>
> Another possible approach would be to do the task using a regular
> expression to replace matching lines (with empty text) either using the
> Search and Replace dialog or a clip with a single ^!Replace command.
>
> Aside from the ^!Setdebug command, it is useful to know that comments
> start with a semicolon, and to stop a runaway clip you press Ctrl+Alt.
>
> Have fun,
> Sheri
>
> H="userdelheads"
> ^!Setdebug on
> :LoopStart
> ^!Find "2006" TS
> ^!Iferror End
> ^!Jump Select_Start
> ^!Select 7
> ;Next command picks up carriage return/line feed on the last line
> ^!Select +2
> ^!Menu Edit/Cut
> ^!Goto LoopStart
> :EndLoop
> ;end of clip
>
> [Non-text portions of this message have been removed]
>

Messages 14974 - 15003 of 23787   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help