Page 1 of 1

Nothing new here

Posted: Sat Jul 11, 2020 3:35 pm
by dunbarx
A small issue.

In another thread, a user used "new card" as a command inline in a handler. "New card" is indeed a menuItem in "object" menu. But there is no reference to that, er, command, that is, nothing in the dictionary with the word "new", with syntax, perhaps,

Code: Select all

"new object [as new name]"
It works also for lots of other objects, though not for dataGrids. The inLine command will allow one to name the new control, the menuItem (limited to a field) will not.

Shouldn't this be updated? Anyone else not know, after over a decade with LC, and three with HC (which would have used "doMenu" to effect the same thing, and annotated the fact) that you could say:

Code: Select all

new field "XYZ"
I have not yet played with the menuItem "new Control", along with everything it encompasses.

Craig

Re: Nothing new here

Posted: Sat Jul 11, 2020 4:30 pm
by richmond62
It's certainly new to me . . .

But, Hey, I came late to the RR/LC party, joining it in 2001. 8)

Re: Nothing new here

Posted: Sat Jul 11, 2020 4:55 pm
by Klaus
In the dictionary for "create": Synonyms -> new

Re: Nothing new here

Posted: Sat Jul 11, 2020 5:23 pm
by dunbarx
Klaus.

Don't confuse me with the facts.

OK. Hmmm, how do I save face here? Ah. Why isn't "create" a synonym of "new"?

Craig

Re: Nothing new here

Posted: Sat Jul 11, 2020 8:47 pm
by richmond62
On the few times I've needed to make things by code on the fly I have
always used create.

And a synonym for create that involved new would surely be make new.

Re: Nothing new here

Posted: Sat Jul 11, 2020 9:00 pm
by SparkOut
I am a bit bemused by the idea that "create" needs a synonym, and as "new" is not a verb, why that should be the choice.

Re: Nothing new here

Posted: Sat Jul 11, 2020 9:48 pm
by dunbarx
Sparkout.
as "new" is not a verb, why that should be the choice.
Thank you. At first I was going to ask the OP how a new card could be made that way at all with such a peculiar construction. But I tried it first and it worked. Who knew?

I thought it was a case where many new users try to speak ordinary english when coding, and though LC is pretty good, it ain't that good, and they get tripped up.

My face is saved, though many think the effort to do that that is not worth the trouble.

Craig

Re: Nothing new here

Posted: Sat Jul 11, 2020 10:07 pm
by bogs
dunbarx wrote:
Sat Jul 11, 2020 9:48 pm
In another thread, a user used "new card" as a command inline in a handler. "New card" is indeed a menuItem in "object" menu. But there is no reference to that, er, command, that is, nothing in the dictionary with the word "new"
SparkOut wrote:
Sat Jul 11, 2020 9:00 pm
as "new" is not a verb, why that should be the choice.
Thank you. At first I was going to ask the OP how a new card could be made that way at all with such a peculiar construction. But I tried it first and it worked. Who knew?
Who indeed? Weellll, I did, but, that is mostly because I spend my time in Mc. Let us take a little trip back in time, and see things as they were.....

...during the dawn of time, 'new' was the way to go!
aPic_new1.png
Ahhhh, I'm home....
But 'new' started loosing ground to the 'create' - shin-ists....
aPic_new2.png
And then along came Jones...
....until finally, 'new' had it's position completely usurped, and later was blacklisted from even showing up in the reference books Image
aPic_new3.png
I see a bad moon arising...
Boy I'm glad I use old stuff! Image

Edit - And just to show how old I really am, I remember a time when new *was* able to be used as a verb :P
What's the verb for new? Here's the word you're looking for.
new (obsolete) To make new; to recreate; to renew.

Re: Nothing new here

Posted: Sat Jul 11, 2020 11:41 pm
by FourthWorld
dunbarx wrote:
Sat Jul 11, 2020 5:23 pm
Why isn't "create" a synonym of "new"?
It gets weirder: I was curious how HC handles object creation, so I found this:
https://cancel.fm/stuff/share/HyperCard ... uide_1.pdf

Short answer: looks like it doesn't. Not at all, for anything except its virtual (non-persistent) menus and for stacks, both of which use "create". The v2.2 Scripting Guide includes no entry for "new".

Apparently, with no direct means of creating objects, the only workaround was to use a GUI element for that, with "doMenu".

Do I misunderstand the contents of Apple's Guide?

And if I do understand it correctly, what happens if I'm making an app where it makes no sense to provide a GUI menu item for creating a button or a field so I've deleted those menu items, but I want my app to be able to do so? How could I do that without "doMenu"?

Re: Nothing new here

Posted: Sun Jul 12, 2020 7:39 pm
by jiml
I too was gobsmacked when I saw that post using 'new' to create a card.

I never knew the voodoo that old 'new' could do.

Re: Nothing new here

Posted: Sun Jul 12, 2020 8:13 pm
by anmldr
OP here...
At first I was going to ask the OP how a new card could be made that way at all with such a peculiar construction.
I have been watching videos and looking at LC Lessons. I picked it up somewhere in them or here on the forum. Anyway, I did not just get lucky trying to use English like construction of the code and find out that it (ta da!) worked. I actually learned it in some of the material. Since it is not common, I will try to remember to CREATE instead.

Thanks for letting me know that it is an oddity :D
Linda

Re: Nothing new here

Posted: Sun Jul 12, 2020 8:19 pm
by richmond62
Thanks for letting me know that it is an oddity
Plenty of oddities round these parts. 8)

BUT, a very friendly and helpful community as well.

Re: Nothing new here

Posted: Mon Jul 13, 2020 12:13 pm
by SWEdeAndy
This is one of the amazing things in LiveCode, and I guess we've all experienced it at some point:
Looking something up in the dictionary, and then your eye catches a word in the Related section, and you go "Hmm, that's interesting".
You then go to that entry and learn about a command/function/keyword you never knew, and you go "Wow, that's really useful - it must be new!". Yeah right!
'Cause then you look at the "Introduced" line and expect to see something like 9.0 but no, of course it's 1.0 - it has been there since the very start. :oops:

For example, I've always used "the number of chars of" until just a few years ago when I stumbled upon length(). :shock:

Re: Nothing new here

Posted: Tue Jul 14, 2020 4:40 am
by dunbarx
Andreas.

It is worse than you think. Both those methods were native ito the first release of Hypercard.

1987. :wink:

Craig

Re: Nothing new here

Posted: Tue Jul 14, 2020 9:29 am
by SWEdeAndy
dunbarx wrote:
Tue Jul 14, 2020 4:40 am
It is worse than you think. Both those methods were native ito the first release of Hypercard.
Indeed, often "since the very start" would not even mean the start of LiveCode (or Revolution, as it were) but HyperCard (and/or Super/Meta-). :)