Page 1 of 1

Stuck at Hello World Error Message

Posted: Sat Jun 13, 2015 8:55 am
by sirreigns
Hey guys and girls.
I'm relatively new to coding and I'm still wrapping my head around this so I apologize in advance if this is a stupid or simple question, but here goes:

I'm coding the Hello World application and I receive an error message. In particular it states:

An error has occurred in behavior of the row template:
Chunk: error in object expression.

There's another person who posted this a few years ago, but his explanation leaves me baffled on how to fix the problem. Let me post the link:
http://forums.livecode.com/viewtopic.php?f=8&t=12885 and the explanation:
To sum up for anyone who has found this thread what you have to do:
1) Create your template in a "Data Grid Templates xxxxxx" stack
2) Create the behavior script on said template
3) Place the datagrid on your card
4) Using the message box: "set the dgProps["row template"] of group <name of data grid and path to it all the way up to stack level> to the long id of group <name of row
template and path to it all the way up to stack level>
5) Again using the message box: "set the behavior of group <name of row template and path all the way up to stack level> to the long id of <control that has the script on it
that you want to use as the behavior>"
6) Enjoy it working =D
So, I've created a template. I go to the behavior script---but i'm lost at the message box? Is this the script box? Is this even the right fix for my problem?

Any help would be super greatly appreciated.

Re: Stuck at Hello World Error Message

Posted: Sat Jun 13, 2015 2:43 pm
by SparkOut
What Hello World application are you trying to create? If it's the lesson here http://lessons.runrev.com/m/2571/l/121876-hello-world , then you have inadvertently added a datagrid to the stack. Datagrids are the most complex part of Livecode and certainly not part of the beginner's Hello World repertoire.
Close the stack, close LiveCode and start again with a clean, empty stack. Does the problem recur? If it does, you have got something strange going on and looks like there is something triggering when you start LiveCode for instance a plugin.
Can you say more about your installation?

Re: Stuck at Hello World Error Message

Posted: Sat Jun 13, 2015 3:11 pm
by sirreigns
OK, let me give that a shot. The data grid addition is on lesson 4 of Hello World (the first app) in Build it With LiveCode. Most of it has already been designed. I really don't want to start with a new stack because of all of the design work I've already put in. I'll delete data grid and start that part again. Thanks a bunch. I'll let you know how it goes.
'
'

Re: Stuck at Hello World Error Message

Posted: Sat Jun 13, 2015 3:54 pm
by sirreigns
So, I remade the datagrid. However, I'm getting a different error.
Error in object expression

Code: Select all

 put the lockMessages into msgsAreLocked
   unlock messages
   set the dgHilite of pControl to pBoolean
   set the lockMessages to msgsAreLocked
end _HiliteControl
That's the code the error finder takes me to. I took out the line "Set the dgHilite of pControl to pBoolean, and that replicated my template into the datagrid. Which is a start, but it's not posting the data from the database.

Any ideas?

Re: Stuck at Hello World Error Message

Posted: Sun Jun 14, 2015 8:33 am
by SparkOut
Sorry I don't have access to the Create It With LiveCode lessons so I'm not sure what you have got here.

The error message you have now, seems to indicate that the contents of pControl are not correct to resolve to a datagrid object on which to set the highlight. Where is the value of pControl set? If you add a line "put pControl" just before the line setting the highlight, what do you get? Does it provide a value that looks like a datagrid element?

As for the rest (and this too, generally speaking) I am wondering if your variable and parameter declarations need a tweak to make sure they are the right scope. I expect pControl to be a parameter set on calling a handler, but other variables may be intended to work as a script local, or a global, in which case they need to be declared as such in the script, usually at the top and outside any handlers. Otherwise you may find that a tVariableName is only accessible within the handler in which it is found, and another handler may contain a tVariableName that will bear no relation to the other one. But this may not be what you are experiencing. Although that's my best guess at the moment.

Re: Stuck at Hello World Error Message

Posted: Sun Jun 14, 2015 5:54 pm
by sirreigns
SparkOut wrote:Sorry I don't have access to the Create It With LiveCode lessons so I'm not sure what you have got here.

The error message you have now, seems to indicate that the contents of pControl are not correct to resolve to a datagrid object on which to set the highlight. Where is the value of pControl set? If you add a line "put pControl" just before the line setting the highlight, what do you get? Does it provide a value that looks like a datagrid element?

As for the rest (and this too, generally speaking) I am wondering if your variable and parameter declarations need a tweak to make sure they are the right scope. I expect pControl to be a parameter set on calling a handler, but other variables may be intended to work as a script local, or a global, in which case they need to be declared as such in the script, usually at the top and outside any handlers. Otherwise you may find that a tVariableName is only accessible within the handler in which it is found, and another handler may contain a tVariableName that will bear no relation to the other one. But this may not be what you are experiencing. Although that's my best guess at the moment.
Thank you so much! That totally confused me since I'm literally on day one of Live Code, and although I understand in general what you said, I couldn't go into my code to fix it. Instead I just moved onto the next lesson. I'l go back to this once I have more knowledge. Thanks for your help.