Let's learn to write programs with LiveCode
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Let's learn to write programs with LiveCode
This series of posts is based on a number of presuppositions:
1. You have never done any computer programming before.
[Or, if you have, you did not really understand what was going on]
2. Your teacher has installed LiveCode on your computer so that when you start it up it
up it looks something like this:
[I am using LiveCode 9.6.x on Macintosh, but most of the time everything will look very much
the same as on Windows or Linux]
-
1. You have never done any computer programming before.
[Or, if you have, you did not really understand what was going on]
2. Your teacher has installed LiveCode on your computer so that when you start it up it
up it looks something like this:
[I am using LiveCode 9.6.x on Macintosh, but most of the time everything will look very much
the same as on Windows or Linux]
-
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
Let's get started by using the Menu to make a "new stack":
- - -
This 'stack' is really like a bit of paper on which we can draw things we want for our programming.
Why a window is called a 'stack' is interesting, but is not very important at the moment.
When it becomes important we'll explain why it is called a 'stack'.
We can make it bigger if we want to by dragging the window bigger with the mouse from the
bottom right corner.
- - -
This 'stack' is really like a bit of paper on which we can draw things we want for our programming.
Why a window is called a 'stack' is interesting, but is not very important at the moment.
When it becomes important we'll explain why it is called a 'stack'.
We can make it bigger if we want to by dragging the window bigger with the mouse from the
bottom right corner.
Last edited by richmond62 on Sat Oct 23, 2021 3:59 pm, edited 2 times in total.
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
If we now look at the TOOLS on the left of our window we will see that there
are lots of things we can put on our window to help us with our program:
-
are lots of things we can put on our window to help us with our program:
-
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
We are going to start by looking at BUTTONS and FIELDS:
-
-
Last edited by richmond62 on Sat Oct 23, 2021 4:22 pm, edited 2 times in total.
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
Let's put a BUTTON on our window by DRAGGING one from the TOOLS:
- -
Now, let's put a FIELD on our window by DRAGGING one from the TOOLS:
-
- -
Now, let's put a FIELD on our window by DRAGGING one from the TOOLS:
-
Last edited by richmond62 on Sat Oct 23, 2021 4:20 pm, edited 1 time in total.
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
We can use a BUTTON to TELL the computer to DO things:
- -
TELLING a computer to DO something is called INPUT
-
And we can use a FIELD for the computer to TELL us things:
- -
When a computer TELLS us something, that is called OUTPUT
- -
TELLING a computer to DO something is called INPUT
-
And we can use a FIELD for the computer to TELL us things:
- -
When a computer TELLS us something, that is called OUTPUT
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
Let's get the BUTTON to ASK for some INFORMATION from US:
The FIRST thing we do is find the SCRIPT EDITOR to enter some CODE:
- - -
NORMALLY we use a BUTTON to get INFORMATION when we CLICK a computer mouse:
-
The FIRST thing we do is find the SCRIPT EDITOR to enter some CODE:
- - -
NORMALLY we use a BUTTON to get INFORMATION when we CLICK a computer mouse:
-
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
When we have typed some CODE into a SCRIPT EDITOR we need to APPLY it:
- -
NOW it is important that the INFORMATION a computer gets goes somewhere so we can see it.
SO it is important that we give our FIELD where we want our INFORMATION to go a NAME:
We need to open the PROPERTY INSPECTOR of our FIELD:
- -
- -
NOW it is important that the INFORMATION a computer gets goes somewhere so we can see it.
SO it is important that we give our FIELD where we want our INFORMATION to go a NAME:
We need to open the PROPERTY INSPECTOR of our FIELD:
- -
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
Here we can change the NAME of our FIELD to something that makes sense to us:
- -
This also makes things easy when we want to send INFORMATION there:
- -
HOWEVER, ALL we have done so far is INPUT some INFORMATION and told the computer to OUTPUT
it again WITHOUT doing any OPERATIONS.
- -
This also makes things easy when we want to send INFORMATION there:
- -
HOWEVER, ALL we have done so far is INPUT some INFORMATION and told the computer to OUTPUT
it again WITHOUT doing any OPERATIONS.
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
We can see this if we CLICK on the PLAY button on the TOOLS bar:
- - -
- - -
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
SO: LET'S try an OPERATION with the INFORMATION we have TOLD the computer:
BEFORE we do that we should NAME our work and SAVE it:
WE need to open the PROPERTY INSPECTOR of our work:
- - -
And NAME our work to something that makes sense to us:
-
BEFORE we do that we should NAME our work and SAVE it:
WE need to open the PROPERTY INSPECTOR of our work:
- - -
And NAME our work to something that makes sense to us:
-
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
And then SAVE our work:
-
-
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
Now, let's CHANGE the CODE in the BUTTON:
- -
And we will see that our OUTPUT has been changed:
- -
- -
And we will see that our OUTPUT has been changed:
- -
-
- Livecode Opensource Backer
- Posts: 9446
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Let's learn to write programs with LiveCode
NOW, let's CHANGE our CODE so the OUTPUT is a bit easier to understand:
- -
- -