Let's learn to write programs with LiveCode

Share tips, tools, and other resources for helping educators bring LiveCode into the classroom

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sat Oct 23, 2021 5:04 pm

With LiveCode we will learn about OPERATIONS:

1. OPERATIONS with NUMBERS.

2. OPERATIONS with LANGUAGE.

3. OPERATIONS with PICTURES.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sat Oct 23, 2021 7:13 pm

----------------------

This is a "time out" posting where 'the teacher' talks anent methodology rather than continues with the class.

Anyone who has bothered to follow what I have presented here today will realise a number of things:

1. This is about as BOG BASIC as one can get.

This is the end result of experience dealing with 8-11 year olds.

2. It uses as little metalanguage as possible, avoids words such as STRING, VARIABLE and so on like the plague (as they
are NOT necessary, even if those of us who sat down in an empty classroom in 1975 thougth they were).

3. I have based this on 2 things;

3.1. Children 8-11.

3.2. My father (who died at 86 3 years ago) who wanted to learn LiveCode at 81 when he had
NEVER learnt any programming language in his life before, lived a whole continent away from me so could only
be instructed by "a thousand pretty pictures" and understood "bugger all" (as he so pointedly put it), "with all
that pompous language."

I have also taken into consideration that ALL the pupils / students I have taught programming classes to

from the Bin Harmal business college in 1989 in the UAE to the school children I teach now

have never had English as a first language, so one has to explain concepts in the simplest, most readily
understandable fashion possible, and cannot assume prior knowwlegde of either any sort of semi-sophisticated
level of English or a lexicon of programming terms in English.

----------------------

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sun Oct 24, 2021 11:27 am

Before we go any further let's look at how we can adjust things we have made so they are
a bit easier to see:
-
c24.jpg
-
c25.jpg
-
We can adjust the TEXT size in a FIELD like this.
-
c26.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sun Oct 24, 2021 11:32 am

c27.jpg
-
We can then RESIZE our FIELD to make space for our larger TEXT:
-
c28.jpg
-
c29.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sun Oct 24, 2021 12:01 pm

c30.jpg
-
c31.jpg
-
c32.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sun Oct 24, 2021 12:11 pm

Now we are going to give 2 sets of information to the computer: 2 INPUTS:
-
c33.jpg
-
c34.jpg
-
You will see that because we GIVE 2 pieces of information to the computer we CANNOT call them both 'it' so we have to put them into HOLDERS.

We can make a HOLDER just by naming it, and that NAME can be anything that makes sense to us and does NOT use a word from
the programming language.

In my example you will see I have chosen YEARS and GENDER as they make sense to me in this program.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sun Oct 24, 2021 12:21 pm

Now we need to tell the computer to perform an OPERATION with those 2 pieces of
information in those HOLDERS:
-
c35.jpg
-
c36.jpg
-
c37.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sun Oct 24, 2021 12:23 pm

c38.jpg
-
As you can see we are already COMBINING NUMBERS and TEXT in our OUTPUT.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sun Oct 24, 2021 1:12 pm

---------------------------------------------
Now, let's take a break from PROGRAMMING to go back to why LiveCode uses the word STACK for what
is, apparently, a windows or a piece of paper on which we can draw things.

A LiveCode STACK can have as many CARDS as it wants: just exactly like a STACK of CARDS or the PAGES in a book:
-
playingCards.jpeg
playingCards.jpeg (7.24 KiB) Viewed 4614 times
-
book.jpeg
book.jpeg (4.89 KiB) Viewed 4614 times
-
c39.jpg
---------------------------------------------

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sun Oct 24, 2021 1:20 pm

This is very useful as we can use different CARDS for different JOBS.

For instance: here's a stck with 2 CARDS where the front CARD contains the PROGRAM TITLE and the second CARD
is where the OPERATIONS take place:
-
c40.jpg
-
c41.jpg
-
You will see that the front CARD has a BUTTON to take the user to the second CARD.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Let's learn to write programs with LiveCode

Post by richmond62 » Sun Oct 24, 2021 1:32 pm

We can give CARDS NAMES so that it is easy to refer to them:
-
c42.jpg
-
c43.jpg
-
and easy when we want to move between CARDS:
-
c44.jpg

Post Reply

Return to “Educational Outreach”