Need help urgent!! Error :(Chunk : No such object) char 1.

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

Post Reply
Tsering
Posts: 4
Joined: Wed May 27, 2015 2:16 pm

Need help urgent!! Error :(Chunk : No such object) char 1.

Post by Tsering » Mon Jul 20, 2015 6:17 pm

Hello! Everyone! I am new to livecode and currently i am working on one language learning app with livecode. But I am facing this problem when I started to work on the second card. The code i wrote on the first card is working correctly as i wanted but when i apply the same to the second card its showing the fooling error message :(Chunk : No such object) char 1. I have put the screen short below.I would really appreciate if any one can help me with this. I have no idea what i am doing wrong!!thank you so much in advance :)

PS: the way i wanted is, when the card opens the fld under zero should remain hidden and when the user clicks on zero it should show the next field. and users goes on to the next number the fld under zero should remain hidden again. like wise same applies to the rest of the numbers too.
Attachments
Screen Shot 2015-07-21 at 1.11.49 AM.png

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Need help urgent!! Error :(Chunk : No such object) char

Post by Klaus » Mon Jul 20, 2015 7:05 pm

Hi Tsering,

1. welcome to the forum! :D

2. The error says that you do not have a field number 16!?
Do you?

Important hint:
Do not address any object with its number!
Once you change the layer of that object on the card, its nummber will also change
and you will need to change all references in your scripts!

Give all your objects meaningful names!
Names ususally do not change automatically :D
AND a clever naming convention will also save a lot of scripting in the end!


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Need help urgent!! Error :(Chunk : No such object) char

Post by dunbarx » Mon Jul 20, 2015 7:09 pm

Hi, and welcome to the forum and LC.

Object references are explicitly married to the card they reside on. I am not sure, but I bet you have a "fld 16", say, on card 1, where everything works fine, but do not have one on card 2. Did you clone the first card? or make a new one from whole cloth.

So which line threw the error? That will tell you which field simply does not exist on that card.

Again, I do not know how your stack is composed, but you might think about methods to share certain properties among the controls on your several cards, if you need a common method of referencing them. So if you named a field, say, "nameField", and cloned that to other cards, an openCard handler in the stack script would find it. Note that if you had a "fld 16" it would find it as well; I am just throwing stuff at you.

Write back with what you find.

What do you mean when you say "when the card opens the fld under zero..." Please be more specific. But whatever you are trying to do, we will fix together, and soon.

Craig Newman

Tsering
Posts: 4
Joined: Wed May 27, 2015 2:16 pm

Re: Need help urgent!! Error :(Chunk : No such object) char

Post by Tsering » Mon Jul 20, 2015 7:26 pm

Hi! Klaus and Craig Newman :)
Thank you so much for the help, after going through you guys reply my problem is solved :D Actually I don't have fled 16 in the first card,the field name in the first card is different!! but now I changed the field name from numeric to alphabetic in the second field and the problem is solved !! Once again thank you so much for your kind help,I am really grateful to you guys! Cheers :D

PS: Craig Newman, I heard you.I will be more specific next time :D
Much Regards
Tsering

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Need help urgent!! Error :(Chunk : No such object) char

Post by dunbarx » Mon Jul 20, 2015 8:53 pm

It takes time to learn the ropes.

One thing I do a lot, since numbers are indeed useful entities, is to, when appropriate, make a naming convention. So fields might be named "abc1, abc2, abc3...". This is pretty boring, but nonetheless has the advantage, as Klaus said, of not being subject to environmental pollution. Do you see what I mean? The number property is a very nice property indeed, but it can be changed by other forces. A name cannot, unless you do so explicitly. Yet the above schema has the advantages of both. Let us say that the above three fields had a width of 75, and you wanted to widen them:

Code: Select all

repeat with y = 1 to 3
  set the width of field ("abc" & y) to 100
end repeat
If you find this cute, write back and say so. If old hat, well, then write back and say so.

Craig

Post Reply