Complete Lessons pdf - Exercise 1 - Page 18 suggestions

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Brother Bill
Posts: 9
Joined: Sat Jul 11, 2020 6:51 pm

Complete Lessons pdf - Exercise 1 - Page 18 suggestions

Post by Brother Bill » Sun Jul 26, 2020 4:54 pm

The book "Complete Lessons" for Exercise 1 on page 18 leaves out a lot of steps for the the newbee LiveCode developer.

After I get stuck trying to get Example 1 to work, I did a bit of research, and came up with the following steps that do work,
and also included a 9 minute handy video that exercises this.

Please consider updating the Complete Lessons book.
And you may share the video located at
www.adrive.com/public/mPFQ9M/Complete%2 ... e%2018.mp4
www[dot]adrive[dot]com/public/mPFQ9M/Complete%20Lessons%20-%20Exercise%201%20-%20Page%2018[dot]mp4

Code: Select all

Example 1: Create example
0. View | Backdrop 
    a. This hides other applications on the main screen.
1. File | New Stack | Default Size
2. Object | Stack Inspector
    a. Name: Example 1 Stack
    b. Close
    c. File | Save
         i. Save to: C:\dev\livecode\LearningCurve\Page 18\Example 1 Stack.livecode
         ii. Your location may be different.
         iii. Click Save
3. Drag and resize Scrolling field to fill most, but not all, of default Card.  
    a. Name: log
    b. Close
4. Drag button below log
    a. Name: btnClear
    b. Label: Clear
    c. Close
5. Right click on Clear button, Edit Script
    a. In left pane, click mouseUp
    b. Enter:
	on mouseUp pButtonNumber
	   put empty into field "log"
	end mouseUp
    c. Click Apply or Control + Enter
6. Test btnClear Button
    a. In Tools palette, click on Browse Tool (Arrow cursor)
    b. Type in some text into field "log", then click on Clear button
    c. In Tools palette, click on Pointer Tool (right of Arrow cursor)
7. Drag another button to bottom center.
    a. Name: btnTestMessage
    b. Label: Test Message
    c. Close
    d. Widen button to have some "air".
8. Make btnTestMessage into a group.
    a. Select btnTestMessage
    b. Click Group Button in Menu Bar icon list
    c. Right click inside group | Property Inspector
    d. Name: grpTestMessage
    e. Label: Test Message Group
    f. [x] Show name
    g. [x] Show border
    h. Border width: 3
    i. Stretch Message box bounding rectangle to show all of group label
    j. To center Test Message
          i. Click Edit Group
          ii. In left pane, click on mouseUp, and enter
	on mouseUp
	   put the name of me && "received the mouseUp message" & return after field "log"
	end mouseUp
          iii. Click Apply or Control + Enter
          iv. Click Stop Editing
          v. Stretch Message box bounding rectangle to show all of group label
          vi. Click Apply button to activate script
9. Test it
    a. Click on Browse tool it Tools palette
    b. Click on Test Message button a few times
    c. Click on Clear button
10. Save
    a. Examine in file system
Explanation for C family developers:
on mouseUp is an event where when the mouse is clicked or enter is typed in.
put <something> after field "log"
1. evaluates something as text, and appends it after the existing text in field named log.
2. evaluates the name of me -- me is the object that sent the event message, in this case, the button
3. name of me is the name of the button: button "my_first_button"
4. && concatenates the next item, with a space added between them.

So in short, here is a long English explanation of what the script does:
When the user clicks my button, or presses enter for default button, or button has focus,
then get the name of that button (me) "button \"my_first_button\"" and append that after the contents of field "log".

jiml
Posts: 234
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: Complete Lessons pdf - Exercise 1 - Page 18 suggestions

Post by jiml » Mon Jul 27, 2020 5:58 pm

Bill,

Thanks for our effort in making that clear explanation and video.

Jim Lambert

Brother Bill
Posts: 9
Joined: Sat Jul 11, 2020 6:51 pm

Re: Complete Lessons pdf - Exercise 1 - Page 18 suggestions

Post by Brother Bill » Wed Jul 29, 2020 1:47 pm

The Complete Lessons book has a strange order.
Consider putting "Hello World" much closer to the front of the book, after initial orientation.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”