Execution Error
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Execution Error
I'm following the LiveCode Tutorial to create a Notes App. I receive the following error in my card "list" when saving the note location and file information.
card "list": execution error at line 10 (Chunk: no such object), char 1
I'm using LiveCode 9.5
Thanks for any guidance.
Keith
card "list": execution error at line 10 (Chunk: no such object), char 1
I'm using LiveCode 9.5
Thanks for any guidance.
Keith
-
- VIP Livecode Opensource Backer
- Posts: 9850
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Execution Error
Do you have a field named "notesList" on that card?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
- Posts: 9445
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Execution Error
There is also a mismatch between lines 12 and 13:
tNotes and tNotesList
tNotes and tNotesList
Re: Execution Error
I have a question that I actually am not sure of in regards to this problem and your question, Richard.
If the handler is 'preOpenCard', doesn't that mean that there can't be ... any object created yet? The card isn't even open, if I understand the way a stack opens up
I might not be understanding it correctly though, which is why I am asking.
Edit - I must not understand how it opens, on testing I couldn't generate an error for the same handler putting empty into a named field
@Keith - link to the tutorial you are following? Also, I'd make sure that as Richard suggested, you actually have a field that is named "notesList", and doesn't contain a different name that is close, like "noteList". Typographical errors are buggers to track down.
If the handler is 'preOpenCard', doesn't that mean that there can't be ... any object created yet? The card isn't even open, if I understand the way a stack opens up
I might not be understanding it correctly though, which is why I am asking.
Edit - I must not understand how it opens, on testing I couldn't generate an error for the same handler putting empty into a named field
@Keith - link to the tutorial you are following? Also, I'd make sure that as Richard suggested, you actually have a field that is named "notesList", and doesn't contain a different name that is close, like "noteList". Typographical errors are buggers to track down.
Re: Execution Error
Bogs, I'm using Livecode 8 Build App Tutorial. I was in the Displaying a Notes session. https://livecode.com/topic/displaying-t ... f-notes-4/
Richmond62, I will review the other stacks to see where “notesList” was created and ensure the names are correct, and take a look at the mismatch between 12 and 13.
Thanks
Keith
Richmond62, I will review the other stacks to see where “notesList” was created and ensure the names are correct, and take a look at the mismatch between 12 and 13.
Thanks
Keith
-
- Livecode Opensource Backer
- Posts: 9445
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Execution Error
Variables (unless explicitly declared as globals) are local to an operation
(i.e. notesList looks local to preOpencard).
(i.e. notesList looks local to preOpencard).
-
- VIP Livecode Opensource Backer
- Posts: 9731
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Execution Error
We cannot see the few lines above what the OP posted. Perhaps variables are declared up there?
Keith?
Craig
Keith?
Craig
Re: Execution Error
Dunbarx and Richmond62, I will check my variables. Thanks.
Bogs, yes, this is one of the Paid tutorial. It's helpful, but maybe I missed a variable or 2. I'm checking. Thanks.
Thanks
Keith
Bogs, yes, this is one of the Paid tutorial. It's helpful, but maybe I missed a variable or 2. I'm checking. Thanks.
Thanks
Keith
-
- VIP Livecode Opensource Backer
- Posts: 9850
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Execution Error
The preOpenCard message allows us to set things up before the card is displayed for the user. Any objects on the card are there and fully addressable, they just haven't been rendered to screen yet.bogs wrote: ↑Wed Sep 25, 2019 9:50 amI have a question that I actually am not sure of in regards to this problem and your question, Richard.
If the handler is 'preOpenCard', doesn't that mean that there can't be ... any object created yet? The card isn't even open, if I understand the way a stack opens up
How did the test differ from the earlier run?Edit - I must not understand how it opens, on testing I couldn't generate an error for the same handler putting empty into a named field
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Execution Error
The mismatch in lines 12 and 13 is an error in the tutorial. There were a few of those throughout the sequence that didn't get caught and fixed. You can use either tNotes or tNoteslist but the two lines must use the same variable name. The first line puts a list of files into a variable and the second one puts the list in that variable into a field.
The "no such object" error means LC can't find a field named "noteslist" on the current card. Check the field name. If other handlers in the tutorial refer to the field as either "noteslist" or "list" then you'll have to fix that mismatch too.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9445
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Execution Error
Whoops! Especially when that isn't a free resource.There were a few of those throughout the sequence that didn't get caught and fixed.
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Execution Error
Someone with the time needs to report it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 4016
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Execution Error
The tutorial is correct.
taken from step "Displaying the list of notes"
step one
variables are ok,
step two
variables are ok
I guess Keith just jumped ahead and left out some steps
Kind regards
Bernd
taken from step "Displaying the list of notes"
step one
variables are ok,
step two
variables are ok
I guess Keith just jumped ahead and left out some steps
Kind regards
Bernd
Last edited by bn on Wed Sep 25, 2019 7:18 pm, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 4016
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Execution Error
This is the script of step two
it is "strict compilation compliant" i.e. all variables are declared and are correctly used.
Not that there might not be errors in some lessons but this code is ok.
Kind regards
Bernd
Code: Select all
on preOpenCard
-- Declare any local variables
local tNotes, tNoteName, tNoteTime, tNotesList
-- Clear the "notesList" field
put empty into field "notesList"
-- Set the deafultFolder, telling LiveCode where to look for files
set the defaultFolder to notesFolder()
-- Get the list of files that are in the default folder
put the detailed files into tNotes
-- Sort the list of files by the modification date
sort lines of tNotes descending by item 5 of each
-- Build a list of notes in the form we want to display in the field
-- Look at each line in the list of note files
repeat for each line tNote in tNotes
-- Get the name of the note file and the last modified date
put character 1 to - 5 of urlDecode(item 1 of tNote) into tNoteName
put item 5 of tNote into tNoteTime
-- Convert the last modified date to a readable date
convert tNoteTime to date
-- Build the list of notes to be displayed
put tNoteName & tab & tNoteTime & tab & ">" & return after tNotesList
end repeat
-- The last character is a return so delete it
delete the last character of tNotesList
-- Put the formatted list into the "notesList" field
put tNotesList into field "notesList"
end preOpenCard
it is "strict compilation compliant" i.e. all variables are declared and are correctly used.
Not that there might not be errors in some lessons but this code is ok.
Kind regards
Bernd