Unable to name new cards within a stack

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, asayd

Re: Unable to name new cards within a stack

Postby Simon » Fri Oct 11, 2013 11:43 pm

Hey Chris,
I know it's late there but do you have skype?
Call me *********
I think there is just a small leap you have to make.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3900
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Unable to name new cards within a stack

Postby SparkOut » Sat Oct 12, 2013 12:22 pm

I'd also volunteer for a screen-share introduction to get you over some hurdles Chris, living in the UK as I do it may be easier to find a time that suits. At least you now have a wider time-window for a bit of help.
SparkOut
 
Posts: 1627
Joined: Sun Sep 23, 2007 4:58 pm

Re: Unable to name new cards within a stack

Postby chris25 » Sat Oct 12, 2013 4:37 pm

Hallo Sparkout, very much appreciate your kind offer, Simon stopped me from hitting the brick wall at the end of the runway yesterday and I actually managed to get the gear up on take-off, weather rough, climb steep, but at least I am in the air. I really welcome your offer - thankyou.

A good piece of advice from Simon yesterday was to begin with a simple little project of my own, which I prefer to that University Tutorial, so I have come up with something Very simple indeed. But to begin I would like to ask a question: Just to understand the Livecode engine/framework here I suppose, I understand stacks and cards and groups and objects, I get the parent-cild inheritance thing (have done a little HTML and CSS in the past); So, I have a situation where the user will click on a list of choices and be taken to another window, will click on a second choice and then be taken to another window, you get the picture, a sort of process of elimination in order to arrive at a solution for the user. For each window do I create a new card within the same stack? Or do I create a new stack, now I know I said I understood these, but it is not yet clear when one should create a new stack.

Kind regards
Chris

Simon tried to send you email but there in none listed for you so just wanted to say a big thankyou for yesterdays leap.

Addendum: (sounds better than PS): I thought it was going to take me days to stumble across an answer to my own question here above, I just read literally half the manual and absorbed as much as I could, so the last question is redundant. Groups and cards working together that seems the way to go at this early stage.
chris25
 
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Unable to name new cards within a stack

Postby Simon » Sat Oct 12, 2013 9:17 pm

Hi Chris,
Glad I could help.

Yes, cards and groups are the way to go.

Craig Newman, another volunteer here in the forums, did say something really cool the other day really cool. Here:
viewtopic.php?f=7&t=17397&p=87703#p87703
Just like the "put" and "get" it really is... put apple in bucket... get apple from bucket.

I think I just found your first post about the robot something or other. One thing we didn't get into yesterday is card scripts and stack scripts.
Just like the button scripts cards and stacks can have scripts e.g.
Code: Select all
on openCard
focus on fld 1
end openCard

But it doesn't end with the objects (card/stack), you may have a function that you use often so instead of writing it out in a dozen buttons you write it once and call it e.g.
Button:
Code: Select all
on mouseUp
put goCaps(fld 1) into fld 1
end mouseUp

Stack:
Code: Select all
function goCaps pWords
   put toUpper(pWords) into allCaps
   return allCaps
end goCaps

That would capitalize all letters in fld 1. Note: goCaps is a function I made up... don't try to find it in the dictionary.

I think I've said more than I should for now.
Keep up the good work. :)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3900
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Unable to name new cards within a stack

Postby chris25 » Sat Oct 12, 2013 9:39 pm

I'll be looking up in the dictionary all those terms. But you surprised me, how on earth can you make up a script? I thought that was universally impossible except by the highest authorities so to speak, the ISO people that is.

Ok I think I am way over my head here still. It all seemed so straightforward........ When I read your post I looked up Focus and FLd, not realising the latter was abbreviated. Anyway I opened up a new stack, dragged a text field and named it Field 01. I then entered the script into the coder labelled Field 01. Just the first script example you gave, well at least now I understand a bit what it is for. Anyway, I pushed the apply button, and then stared at the screen wondering what on earth to do next. tried out a few things, looked around a bit and stared back at the screen.

This little explanation is just to explain to you that I miss obviously some understanding, I do not know what to do with what you told me, except look into the dictionary. I understand that the user must type something into this field, but that is it. I can not hope to understand what you are saying and fully appreciate your explanation because I have no roots and no experience. A bit like you looking up a chinese word in a japanese dictionary. You have to learn japanese first.
Last edited by chris25 on Sat Oct 12, 2013 10:00 pm, edited 1 time in total.
chris25
 
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Unable to name new cards within a stack

Postby Simon » Sat Oct 12, 2013 9:55 pm

Hi Chris,
liveCode is going to blow your mind! :)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3900
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Unable to name new cards within a stack

Postby chris25 » Sat Oct 12, 2013 10:12 pm

It's already blown.
chris25
 
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Unable to name new cards within a stack

Postby Simon » Sat Oct 12, 2013 10:35 pm

Oh, I just had a good laugh "...looked around a bit and stared back at the screen."
Try glaring at the screen you get better results :)

OK for the second set of scripts (all caps)
New stack
drag 1 button & 1 fld (get used to it I'm lazy) on to the stack
paste the "on mouseUp" script into the button
right click on the stack in the application browser and edit script
paste the "function goCaps pWords" into the stack script.
Type "don't give up" into the fld.
Hit the button and place forehead on desk and wonder "What on earth have I gotten myself into" :)

Don't forget to add breakpoints so you can follow the script.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3900
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Unable to name new cards within a stack

Postby jacque » Sat Oct 12, 2013 11:51 pm

chris25 wrote:But you surprised me, how on earth can you make up a script?


I don't know what you learned in the phone conversation, but this makes me think you're missing some really elemental information about what programming is and how LiveCode works to allow it. It may be too early to dig into scripts and debugging and all that stuff. You can't read until you know the alphabet, and the frustration you felt would be because of that.

Basic concepts:

LiveCode is an "event driven" language. That means whenever the user or the OS does something, LiveCode sends a message that it happened.

The message travels through a predefined hierarchy of objects. It will be important to know that hierarchy, but for now just understand it's there.

You write scripts with "handlers" to "catch" the messages you want to act on. Any object can contain a script: buttons, fields, cards, stacks, and other things. Where you put the handler depends on what needs to respond to the message.

A "handler" is a set of instructions about what should happen when the event message is sent by LiveCode. A basic command handler always starts with the word "on" followed by the handler name, and ends with the word "end" followed by the handler name. For event messages, the handler name is always the name of the event, like "mouseUp" or "keyDown". There are other types of handlers, but for now just start with command handlers.

So for example, when you click a button, many messages are sent: mouseDown, mouseStillDown, mouseUp (among others.) You can catch any or all of those in a script depending on whether you want something to happen when those events occur. For buttons a common thing is to do something on mouseUp. That allows the user to depress the button (mouseDown) and slide off it without anything happening. Only if the mouse is actually up while still over the button will the action occur. So you write a handler that "catches" the mouseUp event:

Code: Select all
on mouseUp
  beep
end mouseUp


Now if you put that handler into the script of the button, it will beep when you click it. But if you depress the button and slide off, it won't beep because the mouse didn't go up on the button. You can make the button respond to both messages if you want:

Code: Select all
on mouseDown
  put "Mouse went down"
end mouseDown

on mouseUp
  beep
end mouseUp


Now if you hold down the mouse on the button, the message box will say "Mouse went down". If you slide off, nothing else happens. If you let go over the button, the mouseUp message is sent, the button script catches it, and you hear a beep.

With us so far?

This is one of the best courses for learning LiveCode, and it explains these basic concepts:

http://livecode.byu.edu/indexgeneric.php
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3802
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN

Re: Unable to name new cards within a stack

Postby chris25 » Sun Oct 13, 2013 9:41 am

Dear Simon, It took me all of 2 minutes to figure out what made you laugh: and why you replied with - "Try glaring at the screen you get better results " Then it clicked and I laughed at you laughing! Thanks for that extra, now I get it.

Jacque I had already understood what you said, (basically from the little CSS and HTML that I have done). All the jigsaw pieces do not make sense in isolation, it's fitting them together that will give them meaning, it's a bit like a certain language I know where there are no written vowels, only context ascribes meaning. Anyway I understood the definitions of everything but still they were meaningless to a certain extent - had already looked them up, BUT your explanation brought them all together quite nicely and very logically and the penny dropped in a second. That's the teaching that I like. Thankyou.
chris25
 
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Previous

Return to LiveCode University

Who is online

Users browsing this forum: No registered users and 2 guests