Topics

ClipClass WAS: 'IsNumber' and 'IsAlpha' functions syntax


loro
 

I wrote:
<https://notetab.groups.io/g/Clips/files/ClipClass.zip>
I've skimmed through some of the emails. They are a little confusing, even to me who was there. But I think if you primarily focus on the assignments and the related posts it becomes clearer. Also, a few posts from the Clip list had sneaked in there. And note this is the basic stuff. You won't learn fancy here.

Lotta




--
Computer says no.


James McBride
 

Holy Schnikes, that is a 'lotta' emails (yeah, I just made that pun up.....you can thank me later 😝 )



Now that I know that the clip language handles 'if' statements in a rather strange way, I know that they may require some special debugging. I have a series of conditions that need to be met to set a certain variable and it def doesn’t seem that it works right if I just do:

^!If <condition1> and <condition2> action



This is what learning a new language is all about, finding its idisyncracies.

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of loro
Sent: Friday, July 31, 2020 9:06 AM
To: Clips@Notetab.groups.io
Subject: [NTB-Clps] ClipClass WAS: 'IsNumber' and 'IsAlpha' functions syntax



I wrote:

< <https://notetab.groups.io/g/Clips/files/ClipClass.zip> https://notetab.groups.io/g/Clips/files/ClipClass.zip>


I've skimmed through some of the emails. They are a little confusing, even to me who was there. But I think if you primarily focus on the assignments and the related posts it becomes clearer. Also, a few posts from the Clip list had sneaked in there. And note this is the basic stuff. You won't learn fancy here.



Lotta









--

Computer says no.


loro
 

At 09:23 AM 2020-07-31 -0400, James McBride wrote:
Holy Schnikes, that is a 'lotta' emails (yeah, I just made that pun
up.....you can thank me later 😝 )
Maybe I should buy a domain like alottaemails.com to use for my email needs. :-)

Now that I know that the clip language handles 'if' statements in a rather
strange way, I know that they may require some special debugging. I have
a series of conditions that need to be met to set a certain variable and
it def doesn’t seem that it works right if I just do:

^!If <condition1> and <condition2> action
But sometimes it does!

^!If 2 = 2 ^!calc

I'm confused about this too. Originally it didn't enter my mind that a command could be placed on the same line as a conditional statement. Then I saw some clips that did exactly that. I still keep things on separate lines since that's what I'm used to, but it would be interesting to know what the rules are, when things can be shoved together on one line and when they can't. It seems pretty random to me, but I'm sure it isn't.

Lotta

--
Computer says no.


John Shotsky
 

I do this 'conditional' fairly often
If this condition is false Exit
If this condition is false Exit
Here is what needs to be done, because they were both true.
:Exit
Regards,
John

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of loro
Sent: Friday, July 31, 2020 6:46 AM
To: Clips@Notetab.groups.io
Subject: Re: [NTB-Clps] ClipClass WAS: 'IsNumber' and 'IsAlpha' functions syntax

At 09:23 AM 2020-07-31 -0400, James McBride wrote:
Holy Schnikes, that is a 'lotta' emails (yeah, I just made that pun
up.....you can thank me later 😝 )
Maybe I should buy a domain like alottaemails.com to use for my email needs. :-)

Now that I know that the clip language handles 'if' statements in a
rather strange way, I know that they may require some special
debugging. I have a series of conditions that need to be met to set a
certain variable and it def doesn’t seem that it works right if I just do:

^!If <condition1> and <condition2> action
But sometimes it does!

^!If 2 = 2 ^!calc

I'm confused about this too. Originally it didn't enter my mind that a command could be placed on the same line as a conditional statement. Then I saw some clips that did exactly that. I still keep things on separate lines since that's what I'm used to, but it would be interesting to know what the rules are, when things can be shoved together on one line and when they can't. It seems pretty random to me, but I'm sure it isn't.

Lotta

--
Computer says no.


James McBride
 

Thank you, John! That structure seemed to work for me......seems so obvious to do that, but for some reason, to me, it wasn’t ☹

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of John Shotsky
Sent: Friday, July 31, 2020 10:05 AM
To: Clips@Notetab.groups.io
Subject: Re: [NTB-Clps] ClipClass WAS: 'IsNumber' and 'IsAlpha' functions syntax

I do this 'conditional' fairly often
If this condition is false Exit
If this condition is false Exit
Here is what needs to be done, because they were both true.
:Exit
Regards,
John

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of loro
Sent: Friday, July 31, 2020 6:46 AM
To: Clips@Notetab.groups.io
Subject: Re: [NTB-Clps] ClipClass WAS: 'IsNumber' and 'IsAlpha' functions syntax

At 09:23 AM 2020-07-31 -0400, James McBride wrote:
Holy Schnikes, that is a 'lotta' emails (yeah, I just made that pun
up.....you can thank me later 😝 )
Maybe I should buy a domain like alottaemails.com to use for my email needs. :-)

Now that I know that the clip language handles 'if' statements in a
rather strange way, I know that they may require some special
debugging. I have a series of conditions that need to be met to set a
certain variable and it def doesn’t seem that it works right if I just do:

^!If <condition1> and <condition2> action
But sometimes it does!

^!If 2 = 2 ^!calc

I'm confused about this too. Originally it didn't enter my mind that a command could be placed on the same line as a conditional statement. Then I saw some clips that did exactly that. I still keep things on separate lines since that's what I'm used to, but it would be interesting to know what the rules are, when things can be shoved together on one line and when they can't. It seems pretty random to me, but I'm sure it isn't.

Lotta

--
Computer says no.


Axel Berger
 

John Shotsky wrote:
If this condition is false Exit
If this condition is false Exit
Here is what needs to be done, because they were both true.
:Exit
Yes, that's the canonical way:
If <condition> <label1> [ELSE <label2>]

That way is documented and always works. END and others can be read as
pseudo-labels here, not commands in the usual sense. Without ^!If you'd use
them as "^!GoTo END" not as naked "END" (no idea if that would work at
all).

What Lotta found is:

If <condition> <command to execute>

I'm very surprised that ever works and I'm certainly not ever going to use
it. Why rely on flaky side effects, when it's so easy to do things the
right way?


--
/¯\ 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! --


loro
 

Axel Berger wrote:
What Lotta found is:

If <condition> <command to execute>

I'm very surprised that ever works and I'm certainly not ever going to
use
it. Why rely on flaky side effects, when it's so easy to do things the
right way?
I don't use it either. I still would like to know why it's sometimes OK and sometimes not.

I don't know much programming, but I once read a short book about programming in general. What I took with me is that one should strive for readability above all. That it's more important than compactness and even speed.

I think nested Clip functions are about the most hard to read code I've seen. Sure, I nest too. But sometimes it takes me longer to understand something that I wrote some time ago than it took me to write it in the first place - a lot longer. Especially for demos I think several lines with repeated ^!Set make it easier to follows than 10 nested functions on one row.

And I constantly slap myself for not always writing comments in clips for my own use. When I later want to change them a little it isn't always as easy if it could have been had I written comments and used self explanatory variable names...

Lotta

--
Computer says no.