Can you help me learn? I can't understand it!

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Lorena
Posts: 9
Joined: Mon Oct 10, 2022 5:04 pm

Can you help me learn? I can't understand it!

Post by Lorena » Tue Oct 11, 2022 6:16 pm

Hi!
I apologize first of all to everyone.
I don't know how to program, I don't understand anything, but I am drawn to computers and programming.
A friend of mine who teaches computer science sent me Livecode 7 to do some testing. I fell in love (with Livecode, naturally!).
But like all lovers I am also dumb!

Having said that I ask you for help on this little stack, because I can't get it to work, yet it should be simple:

a. I created a stack with two cards
b. in the second card I created a field and a button. This button has the task to write a sentence in the field
c. I created a button in the first card. My goal is to command the button in the second card for it to write the sentence in the field.

The result I can get is opening the script editor of the second card's button that tells me, "button "Write": execution error at line 2 (Chunk: no such object), char 1".

What I'd like to do is command buttons on other cards to do things on the cards where they reside, but I can't do that. LiveCode's system is like telling me, in the specific case of the example, that the button that should be commanded by my button is as if it were on tab number one, where the field is not. (?)

However, it is much easier to understand if you see the stack that I attach.... :)
I really appreciate your help, I don't know where to turn!
Thanks again!

Lorena
Attachments
Learning_to_fly.zip
(737 Bytes) Downloaded 129 times

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Can you help me learn? I can't understand it!

Post by FourthWorld » Tue Oct 11, 2022 6:36 pm

Where you have this:

Code: Select all

   put "Volare oh oh!" into field "theField"
...you'll want to tell LC where to look for the field by specifying which card it's on:

Code: Select all

   put "Volare oh oh!" into field "theField" of card "DUE"
As long as you're referring to objects on the current card showing when a script is executing, you don't need to specify the card. But as you refer to other cards you'll need to specify that.

Note that this also applies to stacks. You can change anything anywhere, as long as you let LC know where it is. For example, if you wanted to change a field in a stack named "OtherStack", you could write:

Code: Select all

   put "Volare oh oh!" into field "theField" of card "DUE" of stack "OtherStack"
In the User Guide included in the LC installation (see the Help menu), you'll find a great section "Referring to Objects" beginning on page 133 that I believe you'll find very helpful when learning to fly.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Lorena
Posts: 9
Joined: Mon Oct 10, 2022 5:04 pm

Re: Can you help me learn? I can't understand it!

Post by Lorena » Tue Oct 11, 2022 6:57 pm

Thank you very much!
So what I was trying to do is simply impossible!
So I cannot write all the buttons in all the cards and then "remote control" them with other buttons in other cards!

There is no way to say:

Director button, now tell that button on that specific card to behave as if the user clicked it while virtually on that card

Anyway, now I will read the pdf, I didn't know it existed.
I mean... as a first flight I crashed into a stained glass window!

But the wonderful Pink Floyd song cheered me up!
Thank you Richard, nice to meet you!
Lorena

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can you help me learn? I can't understand it!

Post by Klaus » Tue Oct 11, 2022 7:01 pm

Buonasera Lorena,

welcome to the forum!

I can recommend to go through one or all of these stacks to get the basics of LC:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10076
Joined: Fri Feb 19, 2010 10:17 am

Re: Can you help me learn? I can't understand it!

Post by richmond62 » Tue Oct 11, 2022 7:57 pm

If I read your posting correctly, what you want to do should be 100% possible:
-
SShot 2022-10-11 at 21.54.52.png
-
SShot 2022-10-11 at 21.55.54.png
Attachments
Example.livecode.zip
Here's the stack.
(1.16 KiB) Downloaded 115 times

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Can you help me learn? I can't understand it!

Post by FourthWorld » Tue Oct 11, 2022 8:18 pm

Lorena wrote:
Tue Oct 11, 2022 6:57 pm
Thank you very much!
You're quite welcome. Thank you for posting an example of where you were having trouble. Being able to see the code someone's having difficulty with makes it much easier to help.
Anyway, now I will read the pdf, I didn't know it existed.
It's a gold mine. Underappreciated by some, but with hundreds of pages written with the new user in mind, it's really the best first stop for learning LiveCode.
I mean... as a first flight I crashed into a stained glass window!
But you were airborne! Only those who never take flight avoid the risk of a crash landing.
But the wonderful Pink Floyd song cheered me up!
Thank you Richard, nice to meet you!
We have another member here who also speaks Italian and we share similar music tastes. Glad you like that one. Many hear the song as I do, a general metaphor for learning anything, but David Gilmour noted in an interview that it was quite literal, his reflections one learning to fly airplanes. :)

In one part of life or another, we're all learning to fly.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Can you help me learn? I can't understand it!

Post by dunbarx » Tue Oct 11, 2022 8:41 pm

Hi.

As you learn Livecode you will smile at the many ways to do the same thing. For example, Richmond's handler sent a message, "mouseUp" to a button on a distant card. And that is the best way.

But just so you know, you could have told LiveCode to actually click on that distant button, thereby invoking the "mouseUp" handler resident in that button.

My point is twofold. First, have fun with the process. Second, there are well over 2000 language elements, which cover a wide range of arenas, such as the web, Unicode, font nightmares, etc. You only need, to do real work, to know perhaps 50-75 of those and how to use them. You can then add as you need, depending on what you want to do. In other words, you can specialize.

Remember to look in the dictionary. It takes a little practice to know what to search for, based on the question you have in your mind; "Is there something that deals with what I want". With a little practice, and knowing that you should always look at the "related" words in any query you make there, you will find it invaluable.

There are lots of us here who are just waiting to help. You may already have discovered that.

craig

stam
Posts: 3060
Joined: Sun Jun 04, 2006 9:39 pm

Re: Can you help me learn? I can't understand it!

Post by stam » Wed Oct 12, 2022 11:13 am

An often unappreciated resource is also the LiveCode course on Udemy. It’s not free but it’s cheap and while focused mainly on mobile will get the basics in, if you prefer a video-style tutorial at beginner level.
The course is a little bit dated now so layout in the IDE may be a bit different but it’s quite useable.

Lorena
Posts: 9
Joined: Mon Oct 10, 2022 5:04 pm

Re: Can you help me learn? I can't understand it!

Post by Lorena » Sat Oct 15, 2022 7:55 pm

Thank you guys, really!
I did not expect such a loving community. it is just what is needed for someone like me, who is in art history and not in computer science.

Maybe that is why I "fell" on the "remote controlled" button ... but I would like to explain why.

The way I designed my first test stack was, I want to say, "artistic," not methodical, not design.

I sent you an example stack describing the error I encountered, I obviously did not send you my very messy stack on which I am experimenting. It is in fact a mess-and no! It's art! :)

I designed my stack this way: I created many cards, each with their own fields and buttons "doing something with each other."

For example, in a card called "words are important," there is a button that replaces some words with their softer synonyms.

I did this experiment to understand how software can work on text, etc. Consider that I can talk to you with some expertise about oil paints, tempera paints, canvases for painting.... but not about computer tools since I have never touched one.

LiveCode for me my absolute programming tool. The fact that I can do something with it says everything about the goodness of this tool!

Back to us. So.... done all these test cards, I thought to myself...what if I could control all these buttons I created because of buttons put on the first card?

This is because, for example, I would be able to control maybe, depending on the time of day (!?), the style of that text by changing the synonyms (simply with a click of my button in the first card), so when I happened to end up in the "words are important" card, the words would be sweeter....

I realize that's not the way to design it.... but I did the final parts first believing that then, with the button callback, I could, like, have a direction mixer to remote control my sub-buttons!

Now, thanks to you, I have realized that the button that is in an "other card" simply has no consciousness of being where it is, and so it must always be told to the "misdirected" button where it should act.

I, however, in order not to throw it all away, have come up with a bungled "solution," which I will attach in the next post, with my thanks to each of you and the corresponding answers.

For now I will finish this "first episode" because I have certainly bored you enough! I don't want to be taken for a logorrheic person! :)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10076
Joined: Fri Feb 19, 2010 10:17 am

Re: Can you help me learn? I can't understand it!

Post by richmond62 » Sat Oct 15, 2022 8:02 pm

Hey: LiveCode has always struck me as the Artist's Programming Tool. :D

You may be a bit logorh-whatever, but, be warned, so am I . . . lovely to see an artist first and a programmer second.

Feel free to swamp me at least, even if no-one else, with lots of words . . . and I am more than happy to help
you get into the wonderful world of doing things with LiveCode.

If you are "really desperate", you can have a look here:

https://www.facebook.com/profile.php?id=100063797865443

and here:

https://www.facebook.com/RMOXTclasses/

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Can you help me learn? I can't understand it!

Post by dunbarx » Sat Oct 15, 2022 11:56 pm

Lorene.

It is going to be a lot of fun teaching you how to use LiveCode.

Try to send limited, direct questions and problems. It is better for us, and for you as well. We can work forever, but in small steps. You can send samples of stacks, but make sure that you describe specific issues as you go.

Again, step by step.

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Can you help me learn? I can't understand it!

Post by jacque » Sun Oct 16, 2022 5:44 pm

I realize that's not the way to design it.... but I did the final parts first believing that then, with the button callback, I could, like, have a direction mixer to remote control my sub-buttons!
Actually that's fairly common. Many of us do layout first and then write code to make it work. LC is versatile enough to do that.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10076
Joined: Fri Feb 19, 2010 10:17 am

Re: Can you help me learn? I can't understand it!

Post by richmond62 » Sun Oct 16, 2022 5:47 pm

Personally I design my stuff on a bit of paper a long way away from a computer,
and then crack open LiveCode. 8)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Can you help me learn? I can't understand it!

Post by dunbarx » Mon Oct 17, 2022 1:23 am

I never do. I make a card and add controls. Then just add scripts to them.

Once I tried a flowchart before starting a large new project. I thought it would make me be more efficient, anticipate traps and pitfalls, and make the integration overall more compact.

Nope.

I found myself ignoring the thing right away, and just built the thing. I do understand this is wrongheaded.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10076
Joined: Fri Feb 19, 2010 10:17 am

Re: Can you help me learn? I can't understand it!

Post by richmond62 » Mon Oct 17, 2022 2:06 am

No, Craig: there is no 'wrongheaded'.

There are results.

Now, if your way of doing things produces the results you want, and my method produces the results I want: both of those methods are valid.

And I am sure there are very many other ways of getting desired results.

Post Reply