Date   

Any serious interest in code with advanced techniques?

loro
 

Joy wrote:
Sigh. I was worried about people not knowing how to manipulate uploaded
code. It's only obvious what to do if you already know what to do.
No problem. It was because I assumed it was a complete library. When I realized it wasn't I just wrapped H="" around the names of the three clips.

Lotta

--
Computer says no.


Re: Any serious interest in code with advanced techniques?

loro
 

Joy wrote:
Sigh. I was worried about people not knowing how to manipulate uploaded
code. It's only obvious what to do if you already know what to do.
No problem. It was because I assumed it was a complete library. When I realized it wasn't I just wrapped H="" around the titles of the three clips.

Lotta


Re: Any serious interest in code with advanced techniques?

joy8388608
 

Joy wrote:
The code along with the two subroutines have been uploaded in one text
file. The two subroutines should be saved as individual clips so you will end
up with THREE new clips.

That explains it! I didn't realize the headers were missing and was wondering what I looked at when I had renamed the file to .clb and opened it in the clipbook. :-D

Sigh. I was worried about people not knowing how to manipulate uploaded code. It's only obvious what to do if you already know what to do. That's not how I upload code but it might be a good idea in the future. I believe uploading a ready to go, properly formatted clb file to be copied into the Libraries folder would create a new library containing only the main clip and the two subs with everything ready to run. I didn't think of doing it that way. I assumed people already had libraries and would rather create a few new clips in their existing libraries. Sorry for the confusion. I can just look at the text and know what to do. I don't know everyone's individual level of knowledge.

Doing this by memory, I suggest opening the uploaded text document and selecting and copying (control-c) the main clip down to the first subroutine then right clicking on the library window where you have existing clips and choose COPY FROM CLIPBOARD. Repeat for each of the two subroutines. Save the library. You should now have three new clips in your existing library. (Or you can first create a brand new empty library)

The very first line should be the name of the clip (or subroutine) which is what will appear in the Library window. NOTE this first line may or may not be visible depending on a setting in options. If the name of the clip ever inserts itself in your document when running a clip, it's because the clip name appears twice at the beginning of your code. It may only appear once due to the "Hide the clip name line" option. If this is on, the line you see is just text and not the clip name and the clip will insert this line as the text that it is.

For those who may find it useful, I think I covered how to create clips in the "Notetab Intro to Clip Writing.txt" tutorial I uploaded to the main clips file area.

Joy


Re: Any serious interest in code with advanced techniques?

loro
 

Joy wrote:
The code along with the two subroutines have been uploaded in one text
file.
The two subroutines should be saved as individual clips so you will end
up with THREE new clips.
That explains it! I didn't realize the headers were missing and was wondering what I looked at when I had renamed the file to .clb and opened it in the clipbook. :-D

Thank you, Joy.

Lotta


Re: Any serious interest in code with advanced techniques?

joy8388608
 

The code along with the two subroutines have been uploaded in one text file.
The two subroutines should be saved as individual clips so you will end up with THREE new clips.
I have my subroutines in a different library but changed the code so you should put the subs in the same library as the calling program. Easily changed, if you wish. (Change ^!Clip to ^!FarClip and add the library name)

I'm sure it was a mistake for me to notice I didn't code the program to return a Return Code for use when using as a subroutine as I frequently do. This means you can check the code after it is called each time to make sure it didn't find a problem. That required some minor code changes which I think I made correctly but I've learned there are NO safe code changes. When new to a language, I crashed a production system by making ONE itty, bitty, innocent, temporary change to ONE line. My friend who was on call that night was phoning me at 3 AM while I SWORE my change couldn't have been the cause. I learned several things that night...

Let me know if you find any bugs.

Joy


File /Joy_Mycroft/BoxAndUnbox.txt uploaded #file-notice

Clips@Notetab.groups.io Notification <Clips@...>
 

The following files have been uploaded to the Files area of the Clips@Notetab.groups.io group.

By: joy8388608

Description:
Clip code to Box and Unbox selected lines


Re: Any serious interest in code with advanced techniques?

joy8388608
 

Thank you all for your honesty. There is enough interest that I will upload the code soon. If nothing else, someone may find the clip useful.

It's very true we don't have a lot of options for finding existing code elsewhere. Like I said, I did learn quite a bit following all the questions and answers posted here over the years but to go back through all the existing posts would be difficult and boring.

Sorry to hear about Lotta's impending difficulty and I do understand how Axel likes to watch the code run. So do I. I remember doing things manually for hours that I can now automate. It always amazes me. I enjoy coding like artists like to paint and writers like to write. It's my art and I write clips I will possibly never use just for the fun of it. To each his own.

I really do think the code is understandable if you print it out and give it some thought. There are plenty of comments and I can answer questions. Maybe later today...

Joy


Re: Selection box wizard question

John Shotsky
 

Not really - About the best I could do is add a user option to either check all
checklists or not, but usually they will want them all checked. It is a folder
full of individual html files that are to be merged into a single file. I'm
working with 227 such files now, because I need enough variety to find outlier
cases, such as URL's in the wrong place, etc. For my own purposes, I could just
run it with all unchecked, but users would not know how to do that. I may just
add that user option so they can change it from Y to N in the option.
Regards,
John

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of James
McBride
Sent: Monday, August 3, 2020 6:23 AM
To: Clips@Notetab.groups.io
Subject: Re: [NTB-Clps] Selection box wizard question

Hello,
I am not sure that I can help here or not, but I am certainly going to try.
Rather than put all entries with a preceding '_' into your list (which means
that they will be checked in that list), couldn’t you conditionally add the
entry with either the _ or not based on a set of conditions?

--Jim

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of John
Shotsky
Sent: Monday, August 3, 2020 8:41 AM
To: Clips@Notetab.groups.io
Subject: Re: [NTB-Clps] Selection box wizard question

Thanks, Axel, that sounds like it will work for me.
Regards,
John

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of Axel Berger
Sent: Monday, August 3, 2020 5:15 AM
To: Clips@Notetab.groups.io
Subject: Re: [NTB-Clps] Selection box wizard question

John Shotsky wrote:
As it is, I present
them with all boxes checked because that is what is usually wanted.
But what if they want only a couple of those many files?
I presume you know this already and don't want it: You can have a separate
Question first and depending on that present one of two wizards, either all
checked or all unchecked.

Or perhaps a way to dismiss that wizard and present one with all the
checkboxes unchecked. Either way would require some sort of action
other than cancel or ok.
That is easy. Have an unchecked pseudo-entry first "uncheck all" and close with
the normal "OK". Look at that entry first and if checked ignore all others but
reopen the wizard -- with another pseudo-entry "check all".

If the pseudo-entry is unchecked process the rest as normal.

--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --


Re: Selection box wizard question

James McBride
 

Hello,
I am not sure that I can help here or not, but I am certainly going to try.
Rather than put all entries with a preceding '_' into your list (which means
that they will be checked in that list), couldn’t you conditionally add the
entry with either the _ or not based on a set of conditions?

--Jim

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of John
Shotsky
Sent: Monday, August 3, 2020 8:41 AM
To: Clips@Notetab.groups.io
Subject: Re: [NTB-Clps] Selection box wizard question

Thanks, Axel, that sounds like it will work for me.
Regards,
John

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of Axel
Berger
Sent: Monday, August 3, 2020 5:15 AM
To: Clips@Notetab.groups.io
Subject: Re: [NTB-Clps] Selection box wizard question

John Shotsky wrote:
As it is, I present
them with all boxes checked because that is what is usually wanted.
But what if they want only a couple of those many files?
I presume you know this already and don't want it: You can have a separate
Question first and depending on that present one of two wizards, either all
checked or all unchecked.

Or perhaps a way to dismiss that wizard and present one with all the
checkboxes unchecked. Either way would require some sort of action
other than cancel or ok.
That is easy. Have an unchecked pseudo-entry first "uncheck all" and close
with the normal "OK". Look at that entry first and if checked ignore all
others but reopen the wizard -- with another pseudo-entry "check all".

If the pseudo-entry is unchecked process the rest as normal.

--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --


Re: Selection box wizard question

John Shotsky
 

Thanks, Axel, that sounds like it will work for me.
Regards,
John

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of Axel Berger
Sent: Monday, August 3, 2020 5:15 AM
To: Clips@Notetab.groups.io
Subject: Re: [NTB-Clps] Selection box wizard question

John Shotsky wrote:
As it is, I present
them with all boxes checked because that is what is usually wanted.
But what if they want only a couple of those many files?
I presume you know this already and don't want it: You can have a separate
Question first and depending on that present one of two wizards, either all
checked or all unchecked.

Or perhaps a way to dismiss that wizard and present one with all the
checkboxes unchecked. Either way would require some sort of action
other than cancel or ok.
That is easy. Have an unchecked pseudo-entry first "uncheck all" and close with
the normal "OK". Look at that entry first and if checked ignore all others but
reopen the wizard -- with another pseudo-entry "check all".

If the pseudo-entry is unchecked process the rest as normal.

--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --


Re: Selection box wizard question

Axel Berger
 

John Shotsky wrote:
As it is, I present
them with all boxes checked because that is what is usually wanted. But what if
they want only a couple of those many files?
I presume you know this already and don't want it: You can have a separate
Question first and depending on that present one of two wizards, either all
checked or all unchecked.

Or perhaps a way to dismiss that wizard and present one with all the
checkboxes unchecked. Either way would require some sort of action other than
cancel or ok.
That is easy. Have an unchecked pseudo-entry first "uncheck all" and close
with the normal "OK". Look at that entry first and if checked ignore all
others but reopen the wizard -- with another pseudo-entry "check all".

If the pseudo-entry is unchecked process the rest as normal.

--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --


Selection box wizard question

John Shotsky
 

I may have asked this before, but don't remember the answer. I think the answer
is that 'you can't do that'.

Anyway, there are times when a group of files need to be merged together. There
can be many, many (hundreds of) files to merge, mostly single html files to be
merged into one big html file. They problem is that when the user is presented
with the wizard to choose what files they want, they either have to check all
the files they want, or uncheck the ones they don't want. As it is, I present
them with all boxes checked because that is what is usually wanted. But what if
they want only a couple of those many files?

What I'd like is a way to check or uncheck all the boxes while looking at the
wizard. Or perhaps a way to dismiss that wizard and present one with all the
checkboxes unchecked. Either way would require some sort of action other than
cancel or ok.

Ideas?

Regards,

John


Any serious interest in code with advanced techniques?

loro
 

Hi Joy,

Joy wrote:
I've put lots of thought into whether I wanted to invest the time and
energy into making it available but would do it if there is serious interest.
Since we were just talking about compound IF statements and how to learn
new techniques, I thought this would be quite the challenge to look at but
would be a real learning experience for the brave.
<snip>
As discussed before, it does take a surprising and unexpected amount of
time to get code ready for the public even if it is already fully documented
and commented so please be honest about if you will really take the time
to study the code. I'm happy to do it. It's my way of giving back for all
the help I've received here over the years.
I would be interested. But since you ask us to be honest I'll be that. As said, I am interested, but I would probably not study your clip right off. First, I have a lot of catching up to do. First things first and all than. Second, my living situation is about to become really messy. Change of pipe system coming up among other things and I'll be living either at some cheapo and depressing hotel or in the middle of the mess for months, that isn't decided yet. Both options are scary and will probably shrink my already small brain significantly. But I would eventually study your clip, just not straight away. That doesn't mean I'll understand i, but I will try to. :-)

Great of you to offer to do this!

Lotta


--
Computer says no.


Re: Any serious interest in code with advanced techniques?

Thomas Gruber Yahoo
 

Hi Joy, Jim,
I‘d certainly take a thorough look at this if you publish it. As Jim says, any well documented and working example of clip code is welcome, and I particularly like the part about making it sensitive of which version of NoteTab it‘s running in.
So if you‘re willing to do this then thanks in advance.
And yes - publishing code for others is really a different thing from writing and even documenting it just for your own use. So I appreciate that you‘re willing to go through this.
Kind regards
Thomas (Computerhusky)

Am 02.08.2020 um 03:07 schrieb James McBride <mr.james.e.mcbride@...>:

That sounds like an interesting idea....I think. Are you saying that this will be sort of like drawing an ASCII box around certain text, or removes/changes that box?

Truthfully, any code that is well documented and that we can run it and see what it does to further the understanding of the code is a good thing.

This language isn’t like C++ or Javascript or Python where you can just go out to 1 of hundreds or thousands of websites to find example code with accompanying explanations of that code. There are very few places to find examples of Clipcode. I don’t guess that I would be able to understand and completely follow the code, as it sounds a lot more complex than where I am at right now with Clipcode, but it would certainly be welcome.

--Jim

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of joy8388608 via groups.io
Sent: Saturday, August 1, 2020 3:41 PM
To: Clips@Notetab.groups.io
Subject: [NTB-Clps] Any serious interest in code with advanced techniques?

I've put lots of thought into whether I wanted to invest the time and energy into making it available but would do it if there is serious interest. Since we were just talking about compound IF statements and how to learn new techniques, I thought this would be quite the challenge to look at but would be a real learning experience for the brave.

It's a clip that works on selected text and either draws a box around the selected lines, draws an open box, removes an existing box, or converts a previously drawn closed box to an open box.

(An open box does not have the rightmost side which would reduce file size by eliminating spaces to pad those lines.)

The concept is simple but the clip is not.

It can be run directly from the library or toolbar which will cause a wizard to ask for the function.
It can be run with a shift\alt\control key down to specify the function and bypass the wizard.
It can be called as a subroutine.

It will recognize and adapt itself from NTP vrs NTS\NTL which is important because there are some major differences. Some functions are available to some flavors of NT but not to others. The main issue here is the ability to convert tabs to spaces so the right side of the box lines up. There was a lot of thinking about what to do if any tabs are found, what version of NT is running, whether to ask the user what to do if running NTL\NTS and tabs cannot be converted or if the clip should automatically take an action. This is affected by if it is running standalone or called from a subroutine, etc.

In other words, there are a lot of possible conditions where I needed to make decisions like

If (NOT Tab Question Override) AND (NOT called as sub) AND (tabs exist in selection) AND (running NTP) THEN ask-user

which I can do in a single IF statement.

It uses two subroutines which I also use in other clips and works very well. It can even create\uncreate nested boxes.

I use this clip when making notes and also wrote another clip which draws a box around all lines which contain a specified string which calls this clip as a subroutine.

This program is a complete redesign and rewrite in Nov 2019 when I added functions and made it aware of tabs and which version of NT was running.

As discussed before, it does take a surprising and unexpected amount of time to get code ready for the public even if it is already fully documented and commented so please be honest about if you will really take the time to study the code. I'm happy to do it. It's my way of giving back for all the help I've received here over the years.

Joy







Re: Any serious interest in code with advanced techniques?

James McBride
 

That sounds like an interesting idea....I think. Are you saying that this will be sort of like drawing an ASCII box around certain text, or removes/changes that box?

Truthfully, any code that is well documented and that we can run it and see what it does to further the understanding of the code is a good thing.

This language isn’t like C++ or Javascript or Python where you can just go out to 1 of hundreds or thousands of websites to find example code with accompanying explanations of that code. There are very few places to find examples of Clipcode. I don’t guess that I would be able to understand and completely follow the code, as it sounds a lot more complex than where I am at right now with Clipcode, but it would certainly be welcome.

--Jim

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of joy8388608 via groups.io
Sent: Saturday, August 1, 2020 3:41 PM
To: Clips@Notetab.groups.io
Subject: [NTB-Clps] Any serious interest in code with advanced techniques?

I've put lots of thought into whether I wanted to invest the time and energy into making it available but would do it if there is serious interest. Since we were just talking about compound IF statements and how to learn new techniques, I thought this would be quite the challenge to look at but would be a real learning experience for the brave.

It's a clip that works on selected text and either draws a box around the selected lines, draws an open box, removes an existing box, or converts a previously drawn closed box to an open box.

(An open box does not have the rightmost side which would reduce file size by eliminating spaces to pad those lines.)

The concept is simple but the clip is not.

It can be run directly from the library or toolbar which will cause a wizard to ask for the function.
It can be run with a shift\alt\control key down to specify the function and bypass the wizard.
It can be called as a subroutine.

It will recognize and adapt itself from NTP vrs NTS\NTL which is important because there are some major differences. Some functions are available to some flavors of NT but not to others. The main issue here is the ability to convert tabs to spaces so the right side of the box lines up. There was a lot of thinking about what to do if any tabs are found, what version of NT is running, whether to ask the user what to do if running NTL\NTS and tabs cannot be converted or if the clip should automatically take an action. This is affected by if it is running standalone or called from a subroutine, etc.

In other words, there are a lot of possible conditions where I needed to make decisions like

If (NOT Tab Question Override) AND (NOT called as sub) AND (tabs exist in selection) AND (running NTP) THEN ask-user

which I can do in a single IF statement.

It uses two subroutines which I also use in other clips and works very well. It can even create\uncreate nested boxes.

I use this clip when making notes and also wrote another clip which draws a box around all lines which contain a specified string which calls this clip as a subroutine.

This program is a complete redesign and rewrite in Nov 2019 when I added functions and made it aware of tabs and which version of NT was running.

As discussed before, it does take a surprising and unexpected amount of time to get code ready for the public even if it is already fully documented and commented so please be honest about if you will really take the time to study the code. I'm happy to do it. It's my way of giving back for all the help I've received here over the years.

Joy


Re: Any serious interest in code with advanced techniques?

Axel Berger
 

"joy8388608 via groups.io" wrote:
please be honest about if you will really take the time to study the code.
For me that's easy, I won't. I love clips. I really love leaning back and
watch NT chugging along, (Screen update is never turned off, would diminish
all the fun) doing a lot of stuff most people I know would spend hours
doing manually. I love the power, but I see programming purely as a tool
and do as little of it and and that as simple and primitive as I can get
away with.

But many thanks for the offer. I'm sure to turn back to you the next time
I'm stumped.


--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --


Any serious interest in code with advanced techniques?

joy8388608
 

I've put lots of thought into whether I wanted to invest the time and energy into making it available but would do it if there is serious interest. Since we were just talking about compound IF statements and how to learn new techniques, I thought this would be quite the challenge to look at but would be a real learning experience for the brave.

It's a clip that works on selected text and either draws a box around the selected lines, draws an open box, removes an existing box, or converts a previously drawn closed box to an open box.

(An open box does not have the rightmost side which would reduce file size by eliminating spaces to pad those lines.)

The concept is simple but the clip is not.

It can be run directly from the library or toolbar which will cause a wizard to ask for the function.
It can be run with a shift\alt\control key down to specify the function and bypass the wizard.
It can be called as a subroutine.

It will recognize and adapt itself from NTP vrs NTS\NTL which is important because there are some major differences. Some functions are available to some flavors of NT but not to others. The main issue here is the ability to convert tabs to spaces so the right side of the box lines up. There was a lot of thinking about what to do if any tabs are found, what version of NT is running, whether to ask the user what to do if running NTL\NTS and tabs cannot be converted or if the clip should automatically take an action. This is affected by if it is running standalone or called from a subroutine, etc.

In other words, there are a lot of possible conditions where I needed to make decisions like

If (NOT Tab Question Override) AND (NOT called as sub) AND (tabs exist in selection) AND (running NTP) THEN ask-user

which I can do in a single IF statement.

It uses two subroutines which I also use in other clips and works very well. It can even create\uncreate nested boxes.

I use this clip when making notes and also wrote another clip which draws a box around all lines which contain a specified string which calls this clip as a subroutine.

This program is a complete redesign and rewrite in Nov 2019 when I added functions and made it aware of tabs and which version of NT was running.

As discussed before, it does take a surprising and unexpected amount of time to get code ready for the public even if it is already fully documented and commented so please be honest about if you will really take the time to study the code. I'm happy to do it. It's my way of giving back for all the help I've received here over the years.

Joy


Re: My thoughts on multiple topics over the past few days

Axel Berger
 

"joy8388608 via groups.io" wrote:
I hope I don't sound (fill in any one of several words)
Helpful? Experienced? Absolutely right?

I am the one who used to (at the time when there still were handbooks)
unpack new gadgets only after having read and annotated the handbook in
full. After that I unpacked and assembled them, typed in all the settings I
had noted in the handbook in pencil and normally they worked first time.

When asked for help I'm known to demand the handbook first. "I don't know
where it is." "Find it! I'll not even look before I hold it in hand." (Yes,
I would look later, but don't pass that on, please.)

^!Prompt ^$StrReplace(",([^,]+)ZZZ";"\&$1";"^%axel%ZZZ";R)$
Hey, that's great! I'll try to remember it. I'm with Lotta in "one should
strive for readability above all. That is more important than compactness
and even speed." but that idea of yours is not hard to understand -- at
least not after having someone else think of it.

In other words, curly braces pop up as they are found in the code.
Square brackets are put together and shown all at once when the code
starts even if they are scattered throughout the code and not
at the beginning.
Yes, but: Only curly brackets evaluate functions and variables inside the
prompt. I frequently want to make my last entry the default for the next
time the input is asked for. Can't do that with square brackets. (And of
course you can't use square brackets in loops anyway.) On the plus side
they make code more legible:

^!GoTo ^?[]

is much easier than

^!Set %vaiable%=^?{}
...
^!GoTo ^%variable%

at least when they're far apart in a long clip.


--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --


Re: My thoughts on multiple topics over the past few days

loro
 

Hi Joy,

Joy wrote:
Forgive me for lumping several topics together. I wouldn't have time
As a programmer who has had to learn
many languages over the years, I hope I don't sound (fill in any one of
several words) when I offer my advice which is to read the manual. Several
times if you can. It's certainly not the most detailed or clear at times,
but it does answer many questions I'm seeing, gives information and prevents
surprise bugs because it is such a flexible language and loose on the
syntax checking. And there are so many commands, I've often found some I
didn't know about because of the information overload.
True. I think the problem is that one don't always understand fully what the rather terse explanations mean (don't get me wrong, I actually like terse). Then, when one reads again later it's crystal clear - because one now have learnt more and that helps one's understanding tremendously. But it's easy to think it isn't needed to read that basic stuff again.


The manual does state
New since NoteTab 4.8: conditional commands now accept a command statement
instead of a label.

---

Although it seems to work without quotes (I haven't tested), the syntax
for IsAlpha requires quotes around the argument. Not using quotes may cause
it not to work correctly in certain cases.

---

The IF statement cannot use logical arguments such as AND and OR.although
there are ways I've written about several times to emulate this feature.
Ask if you are interested and cannot find it.
Duh. Point proved and taken. ;-o)


A regexp way to replace the last comma in a string.
Lotta's way is easier to debug and understand. This way is shorter and for
educational purposes because it was only recently I discovered regexp is
permitted in StrReplace. (I still don't think well in regexp so I'm sure
this can be improved upon)

^!Set %axel%=Goethe,Mann,Hesse
; ^!Set %pos%=^$StrPosRight(",";"^%axel%";false)$
; ^!Set %axel%=^$StrDelete("^%axel%";^%pos%;1)$
; ^!Set %axel%=^$StrInsert("&";"^%axel%";^%pos%)$
^!Prompt ^$StrReplace(",([^,]+)ZZZ";"\&$1";"^%axel%ZZZ";R)$
This I like. It's good to show different ways to accomplish what's asked for. Maybe even more so when a RexEx solution is given to someone who doesn't do RexEx. That person won't be able to make changes to the code himself. I've always liked when both options are given.

Lotta




--
Computer says no.


My thoughts on multiple topics over the past few days

joy8388608
 

Forgive me for lumping several topics together. I wouldn't have time otherwise.

I, too, was in the same NoteTab beginner boat so I know what it feels like. Clipcode is quite unique but very predictable and usually easy to read when written clearly with comments. As a programmer who has had to learn many languages over the years, I hope I don't sound (fill in any one of several words) when I offer my advice which is to read the manual. Several times if you can. It's certainly not the most detailed or clear at times, but it does answer many questions I'm seeing, gives information and prevents surprise bugs because it is such a flexible language and loose on the syntax checking. And there are so many commands, I've often found some I didn't know about because of the information overload.

It is also VERY helpful to go through as much code (from other people) as you can find to learn new things that you missed in the help files or that weren't mentioned. I've learned a huge amount by doing that and by following discussions like this one.

I don't see it done often but don't see anything wrong with someone posting some code that works but seems long, obtuse or overly complicated and asking if someone knows how to rewrite it better. I'm sure many of the replies would be very educational.

Also, it's fine to ask if someone already has a clip to do one thing or another for ready to use or for a template.

On the topics of the last few days...

The manual does state
New since NoteTab 4.8: conditional commands now accept a command statement instead of a label.

---

Although it seems to work without quotes (I haven't tested), the syntax for IsAlpha requires quotes around the argument. Not using quotes may cause it not to work correctly in certain cases.

---

The IF statement cannot use logical arguments such as AND and OR.although there are ways I've written about several times to emulate this feature. Ask if you are interested and cannot find it.

---

A regexp way to replace the last comma in a string.
Lotta's way is easier to debug and understand. This way is shorter and for educational purposes because it was only recently I discovered regexp is permitted in StrReplace. (I still don't think well in regexp so I'm sure this can be improved upon)

^!Set %axel%=Goethe,Mann,Hesse
; ^!Set %pos%=^$StrPosRight(",";"^%axel%";false)$
; ^!Set %axel%=^$StrDelete("^%axel%";^%pos%;1)$
; ^!Set %axel%=^$StrInsert("&";"^%axel%";^%pos%)$
^!Prompt ^$StrReplace(",([^,]+)ZZZ";"\&$1";"^%axel%ZZZ";R)$

---

Regarding Help with Message boxes

I think I understand the question and I think useful answers were given but I'm not sure so here are my thoughts...

To process part of a file and stop to have it examined and then to continue, some things need be done. The first is to remember the location in the file where processing should restart from either with a bookmark or remembering the line and column. (Be careful the user doesn't toggle the WordWrap as this may cause a problem).
The next thing is to possibly check a variable at the start of the code to know if you need to position the starting point and to possibly skip any processing that only has to be done once and, therefore, was already done if this is a restart.

---

Braces and Brackets in Wizard:

From the manual
When input fields are defined using the square bracket format, the Wizard is displayed before the first Clip instruction is executed/evaluated. The Wizard is built from all such fields encountered in the script. That is how and why you may see multiple input fields in a single Wizard as soon as you click on the Clip while others using curly braces may take a little while to pop up.

In other words, curly braces pop up as they are found in the code. Square brackets are put together and shown all at once when the code starts even if they are scattered throughout the code and not at the beginning.

Joy