Beginner Tutorial Stack Update

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

Post Reply
TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Beginner Tutorial Stack Update

Post by TerryL » Sat Nov 23, 2013 9:20 pm

I've posted Beginner Lab, a LiveCode tutorial stack.
My public stacks, StarterKit containing Beginner Lab can be downloaded at:
http://tlittle72.neocities.org/info.html

It has lessons in logical order with examples and self-paced projects.
Last edited by TerryL on Mon Apr 06, 2015 7:25 pm, edited 9 times in total.
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/openxtalk.html

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4174
Joined: Sun Jan 07, 2007 9:12 pm

Re: Beginner Tutorial Stack

Post by bn » Sat Nov 23, 2013 10:39 pm

Hi Terry,

welcome to the forum.

unfortunately there is a typo in your address given above. "Info" should be lowercase "info"

nice introductory stacks.

this is the link to Terry's stacks
http://tlittle72.tripod.com/info.html

Kind regards
Bernd

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Beginner Tutorial Stack

Post by chris25 » Sun Nov 24, 2013 12:08 am

Hallo Terry, I have not had a chance to look yet, but thankyou for posting this, shall eagerly be studying what you have done. Nice of you to take the time for such a thing.
Kind regards
chris

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: Beginner Tutorial Stack

Post by andrewferguson » Sun Nov 24, 2013 7:45 pm

Hello Terry,
Thank you! What a great stack. It is really detailed.
Is this under the GPL licence (The one that LiveCode Community is licensed under) or have you chosen another licence?
Thanks,
Andrew

keram
Posts: 340
Joined: Fri Nov 08, 2013 4:22 am

Re: Beginner Tutorial Stack

Post by keram » Mon Nov 25, 2013 3:23 am

Hi Terry,

Thank you very much for your tutorial - it's just great! Especially for the real beginners like me. It has a good selection of topics and you are explaining it in a very good way by providing examples - you are a very good teacher!

I think that your tutorial should be included in the official LC download file and also the link to it should be included in all LC accounts.

Well done!

keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Beginner Tutorial Stack

Post by chris25 » Mon Nov 25, 2013 2:00 pm

This is really helpful Terry. I read about the pass and send command and often saw it but really could not grasp what was going on because the language used to describe it was shrouded in mysterious clauses. I read it on your stack and within seconds it was so obvious how to use it and why it might be used. I find so far that your tutorials are really helpful.

I really do not know what other beginners feel, but now I think I see what is really missing from LC tutorials, a basic guide about how to plan your project (the code not the visual structure). This is nowhere to be found - allow me to explain. When I taught photography it simply is not good practise to simply go through the meaning of the shutter speed, the aperture and F stops, the lighting, the colour space, the ISO, the Focal points, custom functions etc etc (yes we have those in photography as well) and explain what each function does. One has to then take a scene and demonstrate exactly how to approach it, a plan, teach them a strategy that acts as a frame but is very flexible a framework within which they will over the months customize as they grow in technique and knowledge, so the first thing to consider would be Light, so decide on ISO. Don't try and work out what shutter speed to use when you first see something (this kind of guidance saves them weeks of needless mistakes)..... and the list goes on. Likewise in LC I have found and strongly suspect that a significant amount of mistakes might not be made if I had the foggiest clue on the following:

Example - I have an idea
Break down idea into chunks, (Code not visual as the visuals and layouts are always done first and to many people this sort of planning is by nature intuitive anyway)
Now, what is the first thing I should be asking? What handlers do I know I need? Or should I be considering the flow and be thinking about ok, this is card this is button, this is stack?
Now what variables and their names am I likely to need, how many?
How do I divide up the thought process into a basic draft programmable frame work?

I hope I am being clear here, as with everything there is flexibility, personal preference, personal strategy. But I really think it would be nice for a beginner to be shown how to go about Planning the writing before actually writing it. I have had to cancel my game idea because (while I believe it is simple enough) practically all of the problems I am having seem to be that while different scripts work in isolation, they flounder when being put together. A command has to be moved because it prevented A from working, so it moved to B and now C does not work and then a variable within a handler seems wonky and so I realise that that needs to be re-done within a command along with a list of other items, maybe if I had an idea on how something should be viewed from the air, then I could dive down upon an area and write, zoom out take another look, dive in and so on. Or is this really something others never do or don't need to do, am I misunderstanding anything here? How do people plan the writing strategy before they actually put a single piece of code together? I am sure many of you just write you r code like a novel, others have a strategy, others write on the fly and go back and re-adjust? Maybe, but I think for a beginner, he needs to have a frame work.
Kind regards
chris

keram
Posts: 340
Joined: Fri Nov 08, 2013 4:22 am

Re: Beginner Tutorial Stack

Post by keram » Tue Nov 26, 2013 4:48 pm

Hi Terry,

I'm going through all the cards on your stack and now I'm on the card 11. The script of the button Day Of Year on that card is this:

Code: Select all

on mouseUp  --day of year
   convert date() to dateItems
   put item 1 of it into ThisYear
   repeat forever
      ask "Please enter a date for this year." with date()
      if it = empty then exit to top
      convert it to dateItems  --test if date
      if the result = empty and item 1 of it = ThisYear then exit repeat
   end repeat
   convert it to short date
   put it into TheDate
   convert it to seconds
   put it into DateSeconds  --seconds to date
  convert "1/1/" & ThisYear to seconds
   put it into StartYearSeconds  --seconds to 1st day of year
   put "Date:" && TheDate &return& "Day Of Year:" && trunc((DateSeconds - StartYearSeconds)/86400)+1 into fld "Display"
end mouseUp
I don't understand why empty is in this line:
if the result = empty and item 1 of it = ThisYear then exit repeat

Can you please explain?

Also, on the card 10 you give a project:

FIRST PROJECT
Try out the logical operators in msg box (ctrl-m).

if "10" is a number then put "yes"
if "3/23/13" is a date then put "yeah"
if "Hello" is not a number then put "yep"
if "3" is in "123" then put "yes"
if "3" is among the items of "1,2,3" then put "yeah"
if "3" is among the items of "10,20,30" then put "yep"
if "10,20,30" contains "3" then put "yes"

All the above lines result in true in the message box, but line 6 cannot be true. I was expecting "yes", "yeah" or "yep" to see in the message box. What's wrong?

Thanks.

keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit

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

Re: Beginner Tutorial Stack

Post by Klaus » Tue Nov 26, 2013 5:31 pm

Hi keram,
don't understand why empty is in this line:
if the result = empty and item 1 of it = ThisYear then exit repeat

Can you please explain?
When you use the CONVERT command and it encounters an error, THE RESULT contains the error!
Example:
...
convert "abc" to dateitems
put the result
...
THE RESULT = invalid date
So he checks here if the uses has enterd a valid date!
All the above lines result in true in the message box, but line 6 cannot be true.
You mean this one:
if "3" is among the items of "10,20,30" then put "yep"
?
I was expecting "yes", "yeah" or "yep" to see in the message box. What's wrong?
Nothing, the ITEMS are
01
02
03
And 3 is NOT an item there!
Hope I understood your question correctly :D


Best

Klaus

keram
Posts: 340
Joined: Fri Nov 08, 2013 4:22 am

Re: Beginner Tutorial Stack

Post by keram » Tue Nov 26, 2013 6:05 pm

Klaus wrote:You mean this one:
if "3" is among the items of "10,20,30" then put "yep"
yes, if you put this line in the message box you'll get true but it should say false

and the message box shows true for all the other lines that I mentioned above, but why not "yes" respective "yeah" or "yep" ?

keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit

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

Re: Beginner Tutorial Stack

Post by Klaus » Tue Nov 26, 2013 6:13 pm

Yep, the message box behaves a bit strange sometimes,
or better, it behaves in a way we cannot reproduce sometimes :-)

Since there is no "beginning" or "end" (ON commandname IF XYZ THEN... END commandname) this
line maybe something that the msg cannot compute as exspected, it needs clear commands like this:
put ("3" is among the items of "10,20,30")
## -< FALSE

That's why this works in a button (where the line is beeing TRIGGERED with on mouseup ... end mouseup)
and not in the MSG.

:D


Best

Klaus

keram
Posts: 340
Joined: Fri Nov 08, 2013 4:22 am

Re: Beginner Tutorial Stack

Post by keram » Tue Nov 26, 2013 6:27 pm

Klaus wrote:Example:
...
convert "abc" to dateitems
put the result
...
THE RESULT = invalid date
So he checks here if the uses has enterd a valid date!
but is invalid result the same as empty?
and if empty is invalid then item 1 of it cannot be ThisYear!
so empty and item 1 of it = ThisYear cannot occur at the same time and so exit repeat cannot happen.
?

keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit

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

Re: Beginner Tutorial Stack

Post by Klaus » Tue Nov 26, 2013 6:35 pm

No, with a VALID date "the result" = EMPTY :D

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: Beginner Tutorial Stack

Post by TerryL » Sat Nov 30, 2013 8:33 pm

To Bernd & Klaus: Everyone makes mistakes. Thank you for correcting my latest. The forum moderators here are kind and patient. I am continually amazed at the depth of knowledge both of you have in LC.

To Chris25: Stack Build Process. I drew the stack elements out on paper. I named the buttons and fields and such on my drawing with descriptions of what I wanted them to do, even a wish-list of features and the subjects to cover. I made several drawings before settling on proportions. I wrote notes and questions and code snippets on the same sheet of paper. I have a Research & Development stack of crazy ideas and half-baked routines in progress, as well as code I think works OK stored in button or field scripts. I pasted the desired code into a pre-formatted blank stack so I don't have to keep re-inventing the same things. It took about 3 months, and another month on-and-off to de-bug and check for errors.

To Keram: Among Operator. I was attempting to show the subtle differences of the comparison operators IS IN, CONTAINS, and AMONG. These are useful testing user input. When using the comparison operator AMONG, the ValueToFind "3" and StringToSearch "10,20,30" must match the modifier used: chars, words, items, or lines.
"3" is in "10,20,30" --true
"10,20,30" contains "3" --true, equiv & converse of IS IN
"3" is among the chars of "10,20,30" --true, "3" is a char found.
"3" is among the items of "10,20,30" --false, "3" is an item NOT found. The items are "10", "20", and "30".

I'll keep the latest version of Beginner Lab on my website. Email me an error list and I'll try my best to fix.
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/openxtalk.html

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

Re: Beginner Tutorial Stack

Post by jacque » Sun Dec 01, 2013 8:13 pm

chris25 wrote: I have had to cancel my game idea because (while I believe it is simple enough) practically all of the problems I am having seem to be that while different scripts work in isolation, they flounder when being put together.
This is probably due to a gap in knowledge about the message hierarchy. The message hierarchy is critical to understanding how LiveCode works and is presented early in the scripting conference stacks. Without knowing how messages flow from one object to another, you'll hit all kinds of obstacles. Once you have a firm grasp of how messages travel through the system, it will become second nature to place the handlers at the appropriate level.

If you search for "message hierarchy" in the User Guide you'll find several references. Section 5.3 goes into a more detailed explanation. You can also look at this stack in the scripting conferences: http://www.hyperactivesw.com/revscriptc ... rarchy.zip
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: Beginner Tutorial Stack Update

Post by TerryL » Sat Dec 07, 2013 8:26 pm

Thanks to those who emailed suggestions and errors.
I've placed an updated Beginner Lab for download on my website.
Hopefully this newer version will give a better experience. It has three new lessons (speech, array, substack), broken examples fixed, details cleaned up. Terry

http://tlittle72.neocities.org/info.html
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/openxtalk.html

Post Reply