Execution Error

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

kespears
Posts: 27
Joined: Sat Aug 04, 2018 2:07 pm

Execution Error

Post by kespears » Wed Sep 25, 2019 2:20 am

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
Attachments
Screen Shot 2019-09-24 at 8.20.00 PM.png

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9850
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Execution Error

Post by FourthWorld » Wed Sep 25, 2019 4:50 am

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9445
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Execution Error

Post by richmond62 » Wed Sep 25, 2019 6:16 am

There is also a mismatch between lines 12 and 13:

tNotes
and tNotesList

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Execution Error

Post by bogs » Wed Sep 25, 2019 9:50 am

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 :roll:

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 :D

@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.
Image

kespears
Posts: 27
Joined: Sat Aug 04, 2018 2:07 pm

Re: Execution Error

Post by kespears » Wed Sep 25, 2019 1:23 pm

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
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9445
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Execution Error

Post by richmond62 » Wed Sep 25, 2019 1:49 pm

Variables (unless explicitly declared as globals) are local to an operation

(i.e. notesList looks local to preOpencard).

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9731
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Execution Error

Post by dunbarx » Wed Sep 25, 2019 2:57 pm

We cannot see the few lines above what the OP posted. Perhaps variables are declared up there?

Keith?

Craig

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Execution Error

Post by bogs » Wed Sep 25, 2019 3:47 pm

kespears wrote:
Wed Sep 25, 2019 1:23 pm
Bogs, I'm using Livecode 8 Build App Tutorial.
Ah I see, this is a restricted tutorial that you actually paid to read!

I was thinking it was possibly a typographical error even in the tutorial, but I've never tried them myself.
Image

kespears
Posts: 27
Joined: Sat Aug 04, 2018 2:07 pm

Re: Execution Error

Post by kespears » Wed Sep 25, 2019 5:13 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9850
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Execution Error

Post by FourthWorld » Wed Sep 25, 2019 5:14 pm

bogs wrote:
Wed Sep 25, 2019 9:50 am
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 :roll:
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.
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 :D
How did the test differ from the earlier run?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7257
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Execution Error

Post by jacque » Wed Sep 25, 2019 5:26 pm

kespears wrote:
Wed Sep 25, 2019 2:20 am
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
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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9445
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Execution Error

Post by richmond62 » Wed Sep 25, 2019 5:33 pm

There were a few of those throughout the sequence that didn't get caught and fixed.
Whoops! Especially when that isn't a free resource.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7257
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Execution Error

Post by jacque » Wed Sep 25, 2019 5:57 pm

Someone with the time needs to report it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4016
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Execution Error

Post by bn » Wed Sep 25, 2019 6:56 pm

The tutorial is correct.

taken from step "Displaying the list of notes"
first iteration of handler.png
step one
variables are ok,

second version of handler.png
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.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4016
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Execution Error

Post by bn » Wed Sep 25, 2019 7:16 pm

This is the script of step two

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”