Re: [Clip] Pseudocode as a way to learn programming
- At 03-20-10 00:06, Chris Laarman wrote:
>Anyway, if I should ever start writing Clips in NoteTab, I wouldIf you spend any time at all in NTB, I would encourage you to start
>definitely benefit from the lessons learned in JSP and N-S diagrams.
writing clips. I procrastinated for years due to laziness, strange
looking syntax, no perceived need -- whatever. I guess it seemed valid
at the time. However, after a long, steep and painful (unnecessarily so
I feel), learning curve I am a convert to scripting.
I would suggest starting with a few very small (2, 3, 4 line) clips that
automate some of your common tasks:
Create a personal clip library:
(see my 11-18-09 post if you want to find its location but not necessary)
display the libraries bar [View | Libraries bar],
click on any clip
click on the cliplib name above the cliplib panel & enter your new name
press return and save the new file
right click in the cliplib panel and choose "Add New Clip"
create and save some clips
Create a personal clipbar [View | New; right click | save as],
drag each of your clips to your personal clipbar
right click on the generic icons to replace them with meaningful ones
Now you have the convenience of single click personal power functions.
Careful though - it's addictive!<g>
Use the built-in Clip programming help file. One BIG TIP to ease the
learning curve is the follow the syntax EXACTLY. This especially holds
true for delimiters - do NOT add a single space to make the code easier
to read or debug - it will fail! That is my single biggest complaint about
NTB's clip syntax and it is such an unnecessary restriction. It is trivial
to parse multiple spaces and it has caused me (and I am sure countless
others), untold hours of needless head scratching. [end of rant]
Another biggie time saver and power tool is RegEx. The syntax is even
more intimidating and esoteric than the clip syntax but its looks are
worse than its bite, especially for someone who has dome some
programming. The power of RegEx is truly amazing (and may be used
in the menu bar Find & Replace commands as well as clips). Once you
have tried it you will never go back! One RegEx search pattern can
replace an entire page of clip code!
The hardest part for me was getting the concept of what a regular
expression actually is and its use. Many help files and tutorials forget
to describe the on/off switch - the authors are so familiar with the product
they don't go back far enough to help the newbie get started.
A regular expression is an encoding of a pattern of text in a document
which may be used to search for, change and/or manipulate said text.
The simplest regular expression is a simple, static string of characters.
This is the same as the normal string in the menu bar Find & Replace
commands such as looking for a match of "abcdef". The power of RegEx
comes from adding variability to the search to the search criteria. This is
similar to a simple search engine's "<prefix>*<suffix>" to find any and
all text between (and including), the prefix and suffix.
In RegEx this becomes, for example, "abc.*?xyz" (for no embedded
line breaks). [In RegEx each syntactical element has a distinct and
well defined meaning: in the example, the "." means any character,
the "*" means zero or more of them, and the "?" means stop at the
first occurrence of "xyz".] The power of RegEx comes from combining
these simple elements. Again, start small and gradually add scopes,
sub-patterns, conditionals, alternates, groups, character sets, etc.
Experiment with some simple regular expressions in the menu bar
commands using the RegEx option checkbox.
In addition to the NTB RegEx help file see my post of 09-04-09:
The Perl 5 RegEx tutorials include a quick version and a fairly complete one
(although the Perl implementation is not the same as PCRE, the concepts
and constructs are almost identical. Certainly a good learning tool):
Docs Home: http://perldoc.perl.org/perlre.html
This Wikipedia PCRE article includes interesting background and
The PCRE home page (http://www.pcre.org/) has links to the FTP repository
[This is the source, almost verbatim, for the NTB RegEx Help file]
v7.8 Win Help:
and Sheri's (silvermoonwoman2001), posts for links to more tutorials and
Jeffrey Friedl's soft back book, "Mastering Regular Expressions (3rd Edition)"
[10-17-09]: There is a Wiki on PCRE that might be helpful:
Lastly, as you probably have noticed, help on this forum is freely given and
For every expert, there is an equal and opposite expert.
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 9.0.791 / Virus Database: 271.1.1/2756 - Release Date: 03/19/10 00:33:00
[Non-text portions of this message have been removed]
- Art Kocsis <artkns@...> on Sat, 20 Mar 2010 17:16:33 -0700:
>At 03-20-10 00:06, Chris Laarman wrote:Art, thank you for your extensive message!
>>Anyway, if I should ever start writing Clips in NoteTab, I would
>>definitely benefit from the lessons learned in JSP and N-S diagrams.
>If you spend any time at all in NTB, I would encourage you to start
>writing clips. I procrastinated for years due to laziness, strange
>looking syntax, no perceived need -- whatever. I guess it seemed valid
>at the time. However, after a long, steep and painful (unnecessarily so
>I feel), learning curve I am a convert to scripting.
My reaction must be disappointing: I hardly spend time in NoteTab. On
the other hand, I have been a lurking member of this Yahoo Group for
years, glancing at the Subject lines and storing (keeping) all
messages. Just to get a notion of when I should use NoteTab (Pro)
instead of other software and have the discussions at hand.
This latest message of yours even made it to a special reference
Time for me to get back to lurking before staying off-topic.