Author Topic: Let's Learn LiveCode computer programming  (Read 17872 times)

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #30 on: Dec 06, 2019, 06:50:42 PM »
Name your stack "Try Out 1"

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #31 on: Dec 06, 2019, 06:54:18 PM »
Save your stack:

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #32 on: Dec 06, 2019, 06:55:49 PM »
I should say "Here endeth the first lesson" but that is, strictly speaking inaccurate
as we have done NO programming yet.

Tomorrow
we will start on numerical operations.  :)

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #33 on: Dec 06, 2019, 06:59:14 PM »
If any one here feels I am progressing extremely slowly, well, yes, I am . . .

I am working at the sort of speed I would expect someone who knows almost
nothing about programming at all to progress.

I would ask all of you who do feel I am going too slowly to bear with me, for,
as my Army Cadet Commander told me years ago, "You always make sure, when you
are walking across the hills that you walk at the speed of the slowest member of your team."  :)

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #34 on: Dec 07, 2019, 10:22:26 AM »
Now we need to put some fields on our stack:

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #35 on: Dec 07, 2019, 10:23:49 AM »
DRAG a field twice onto your stack so you have 2 fields:

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #36 on: Dec 07, 2019, 10:26:52 AM »
Now name the fields "fINPUT" and "fOUTPUT" respectively:

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #37 on: Dec 07, 2019, 10:27:34 AM »
and the second field:

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #38 on: Dec 07, 2019, 10:39:13 AM »
Now it is time to do some programming.

Open the script editor of the button "ACTION"

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #39 on: Dec 07, 2019, 10:46:50 AM »
I'm just dropping this chart in here as computers use different
Mathematical Operator symbols to what we all used at school.

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #40 on: Dec 07, 2019, 10:47:56 AM »
Now, type in your first piece of code:

You should be able to see that this will multiply whatever
number is in the field "fINPUT" by 2 and put it into the field "fOUTPUT"

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #41 on: Dec 07, 2019, 10:50:25 AM »
Now APPLY the script
(this is to make sure that the script is 'fixed' where it is meant to be).

Click on the button in the top-left-hand corner of the script editor labelled 'APPLY':

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #42 on: Dec 07, 2019, 10:53:08 AM »
Close the script editor.

Save your stack.

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #43 on: Dec 07, 2019, 10:55:18 AM »
Select the Browse tool from the Tool Palette.

richmond62

  • Hero Member
  • *****
  • Posts: 9193
Re: Let's Learn LiveCode computer programming
« Reply #44 on: Dec 07, 2019, 10:57:18 AM »
Now test your stack by entering a number in field "fINPUT" and clicking on the "Action" button.