Re: [Clip] Go To Physical Line, Structured Programming, Tutorials
- Alan_C wrote:
[goto physical line]
>> ^!Set %wraps%=^$IsWordWrap$Ah, silly me. Well, I'll be sure to glance it through the next time. Are all
>> ^!IfTrue ^%wraps% ^!SetWordWrap "off"
>> ^!Menu "Search/Go to Line"
>> ^!IfTrue ^%wraps% ^!SetWordWrap "on"
> Yes, you've hit on what is known. <snip> found in the archives
of the archived clips available via the note tab dot com site? Another thing
I've been wondering is why so few clips are distributed with NoteTab. Surely
these days file size is not an issue if you zip or rar things up. It would
be great if the most popular and or heavily requested clips could be bundled
Are there any ways of adding clip commands to menus? I'd like to put my
alternative go to line command in the search or NoteTab context menu. SUre
you can use the in-context clip book, for example, but it doesn't feel as
integrated as the native NoteTab commands. TOolbars are fairly visual, as
well, and cannot receive the keyboard focus without screen reader specific
[structured programming and variables]
>> while or for loop, is the only way some label and an if thatWell I've gotten used to such stuff but generaly speaking find language
>> conditionally jumps back to that label
> ^!Goto your_label_here
level support for loops preferrable. Without them it feels almost like some
high-levle assember with an instruction set geared towards text.
> do_while_whatever being the pattern. the whatever is for uniquenessAnd you can think of the do_while_ prefix as a poor man's namespace. Are
there length restrictions about labels? There are in batches and thus one
has a hard time thinking of meaningful label yet unique names within nested
> <snipped> Mr. Wayne Van Weerhuitzen has in the files area an articleThanks, I'll take a look at it at some point. Code templates can be
> both about programming and flow control as applicable to Notetab.
moderately useful. are there any good clip tutorials? I've taken a look at
one clip tut but would prefer something that resembles a crash course for
programmers. The official docs, that are mostly a reference, are a bit too
reference like yet not formal enough. I'm a big fan of the style found in
the K&R C book and the humorous varient in Perldoc. The big issue for me is
I already know Perl and thus am reluctant to hack around with clips unless
true NoteTab integration is needed. Guess I'm just lazy in the bad sense.
Are there any "conversion" examples that show why I should use Clips in
stead of language X for text processing? I know I should put more effort
into learning clip but it's rather low in my priority queue of things to do.
I had the same problem about learning Perl, coming from the Java world,
before reading the learning and programming Perl books, and just now have
the same problem about Python. But that's almost OT.
[back to structured programming]
>> 2. Can variables be localized to a label or blockAh, thanks for a clear and definite answer. So there's not even a file
> No. All are global.
scope. That is if you have code in several files are the variables visible
absolutely everywhere? That might be a problem in maintaining a general
llibrary of useful clip functions written in the clip language. I've noticed
that when new clip funcs do get added, they are native code rather than clip
code, probably for speed and expressiveness.
>> 3. Why do you need the up arrow ^ to refer to a variable's value? IYeah, I know, but let me gripe about the up arrow a little, <smile>. The
>> mean what good is the name, without the up arrow, unless it is some
>> reference or pointer to the contents of that variable.
> I don't grasp what your point is. <snip>
> Notetab it's (well, different, and also) very simple. Either assign to a
> variable or extract the content of a variable.
general rule of thumb seems to be if it is an l-value, something being
assigned to, you don't use the up arrow. Otherwise, if it is an r-value
something being assigned, you do. But one would think the language could be
smart enough to know when an l-value is ment. No other language is this
primitive. It's just a minor annoyance but feels odd.
it is almost like if you had to tell C when you ment the colon in a case
label and when it is the question colon operator for flow control. Coming
from Perl, I've gotten used to the parser being smart and guessing right in
Which reminds me, one of the things in clips that has tripped me up is not
requiring that variables be declared explicitly. So if one says something
The language actually thinks you want to introduce a new variable even
though it is an actual parameter for a function and not being assigned to.
as the up arrow is needed for r-values, the language could actually flag
that as a compile time warning e.g. tryihng to take the value of ariableName
when it has not been set. I know Perl works the same as clip without strict
but in it you can be strict if you like. Again I do realize comparing an
independently developed domain specific language for one app against a
general purpose programming language is a bit harsh and unfair. I know
parsing and interpreting sure ain't easy, although there's nothing magical
about either. Well at least clips are much better than Cakewalk application
language. Which has a lisp:ish parentheses-heavy syntax but only to make the
language easy to parse.
>> 4. How do I create (possibly nested) records or structs? say I'dThanks for the tip still.
>> like to store an array of 100 persons with fields name and age
> That's not quite on the money. (perhaps someone else has it to
And in general thanks for the post. YOu've clarified a number of things that
the clip manual doesn't state in programmer jargon. It never says variables
are global unless you make them persistant by writing them down in ini files
and so on. It just implies things and generally tries to avoid programmer
jargon. that's ok in an intro doc but the help file is actually the language
Hope you don't mind my complaining about too loose typing and ugly syntax. I
guess I've just gotten used to the general purpose languages and am maybe
expecting too much from clips. Or then it is your typical change resistance
again. Kind of like my friend complaining about Java not having pointers
when he didn't know references. But oh well, I'm drifting into OTish
territory again, so I'll stop right here.
With kind regards Veli-Pekka Tätilä (vtatila@...)
Accessibility, game music, synthesizers and programming:
- --- In firstname.lastname@example.org, Veli-Pekka Tätilä <vtatila@...> wrote:
> >> 2. Can variables be localized to a label or blockI disagree. Variables can be localized by using ^!ClearVariable on
> > No. All are global.
specific variables where needed. Also, variables are lost when you
change libraries (except variables prefixed with "p_", but those are
lost if you close the clipbook), and there is a different scope for
variables set through the clip playback from the clipbook vs through
the clipbar (which is to say, the same variable may exist in both
places but have a different value). If you want a truly global variable
you will need to write it to the ini or registry and read it back where
- On Sunday 05 November 2006 13:57, Veli-Pekka Tätilä wrote:
> Alan_C wrote:<snip>
> <snip> AreNot at the notetab site. But it's at the yahoo groups web site.
> all of the archived clips available via the note tab dot com site?
(I Google for: yahoo groups) turns up a few links of which the next is one of
start there. log in with your yahoo groups username and password then your
groups will be shown. click on ntb-clips and then can use their search. Yes
AFAIK all can be searched at this site.
At Google can search the yahoo groups domain (hits more than 1 notetab mailing
list archive though) thus:
> would be great if the most popular and or heavily requested clips could beyahoo groups www files area. And also,
> bundled with NoteTab.
> Are there any ways of adding clip commands to menus? I'd like to put myIt's already on the menu (of version 5 Notetab Pro)
> alternative go to line command in the search or NoteTab context menu.
search > go to line
alternate: Shift + Ctrl + L
That brings up a dialog where you then enter the line number that you want to
> SUreThe above is keyboard integrated. Does it work for you?
> you can use the in-context clip book, for example, but it doesn't feel as
> integrated as the native NoteTab commands. TOolbars are fairly visual, as
> well, and cannot receive the keyboard focus without screen reader specific
> And you can think of the do_while_ prefix as a poor man's namespace. AreI do not know. I've seen some that (to me) appear long and work. But how
> there length restrictions about labels?
long can go with them, I don't know.
Notetab is an editor that is programmable. To write a clip is to write a
macro. It's a macro language, albeit a powerful one.
> are there any good clip tutorials? I've taken a look atI don't know where to refer you to here. cliptut written by Jody Adair is
> one clip tut but would prefer something that resembles a crash course for
> programmers. The official docs, that are mostly a reference, are a bit too
> reference like yet not formal enough.
good. But I think it leans more towards non programmers. Perhaps search and
peruse the clips at yahoo groups web site? There's also another emailing
It's now rather inactive but would good to join it so can then search it at
the yahoo groups as I explained up above.
> I'm a big fan of the style found in<snip>
> Are there any "conversion" examples that show why I should use Clips inI'm like you. I just use whatever I want. Perl integrates well with Notetab.
> stead of language X for text processing?
If you haven't already and want to use Perl in Notetab then I'd highly
recommend you search both ntb-clips and ntb-scripts groups at yahoo groups
for relevant search terms. It's not all that difficult to use Perl (or
Python) from within Notetab.
> I know I should put more effort<snip>
> into learning clip but it's rather low in my priority queue of things to
(just a guess) I'd guess you could mostly Perl from within Notetab and,
outside of this, learn the remainder of the clip language at your leisure.
> >> 2. Can variables be localized to a label or blockWell, I got corrected some on this :-) I only meant that in a general way and
> > No. All are global.
yes there are variances from that and yes you can clearvariable -- and
What I meant by that is "global in the sense that from within the clip where a
certain specified variable exists" which would be very near to what Perl
calls "file scope".
But, forgive me for I was too general and I did not add on enough specifics
onto my generality. And, disclaimer, I may still not have tagged on enough
specifics onto my this/these generality(s).
Once again, it is a macro language. Many things you accustomed to from using
programming languages, you will not find (at least not *directly* find)
direct equivalents to them in this language.
> it is almost like if you had to tell C when you ment the colon in a caseOnce again, a macro language. In some cases there will be no direct
> label and when it is the question colon operator for flow control. Coming
> from Perl, I've gotten used to the parser being smart and guessing right in
> ambiguous situations.
equivalents to what's in a programming language.
> Which reminds me, one of the things in clips that has tripped me up is notYou could put in a feature request.
> requiring that variables be declared explicitly. So if one says something
> ^!Set %VariableName%=Data
> And then:
> ^!Prompt ^%ariableName%
> The language actually thinks you want to introduce a new variable even
> though it is an actual parameter for a function and not being assigned to.
> And in general thanks for the post. YOu've clarified a number of thingsAn ini file is not needed for persistence. (to persist across sessions).
> that the clip manual doesn't state in programmer jargon. It never says
> variables are global unless you make them persistant by writing them down
> in ini files and so on.
An ini can hold the values seperate from the clip. And another, ini
facilitates the ease to change a value(s) from one session to the next (write
a different value to the ini file).
There may be even more that an ini can do.
But a variable inside a clip comes back each time that clip is launched which
means that this variable persists across sessions. (mostly so or in general,
but also see my disclaimer above)
<snip about typing and clip syntax>
It's a macro language. Take it for what it is.
It's a language with which to "program" the editor. But it is not
a "programming" language.