Objects names
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Objects names
ciao all,
I have a small doubt. may cause problems to designate with the same name 2 objects (e.g. 2 Text Field), into 2 different cards ?
regards
franco
I have a small doubt. may cause problems to designate with the same name 2 objects (e.g. 2 Text Field), into 2 different cards ?
regards
franco
Re: Objects names
No, but may depend on your scripting 

Re: Objects names
Hi.
What Klaus said. However, this is sometimes a very useful thing. For example, you can have a group that contains a single text field, behaves like a background, and will therefore appear on many cards, including any new ones you create. This will have the same name on all cards, and you manage that at the card level:
The word would go into the field only on card 20 (Never mind that you can make all the text the same. That is another story)
Problems usually arise, as Klaus mentioned, when you try to reference two similarly named objects on the SAME card;
--with two fields of that name on that card
In this case, LC will place the text into the field with the lowest layer number. This may not be what you wanted.
If you have these fields on different cards, then the problem is usually not so great, since only the field on the current card will be directly accessible.
Craig Newman
What Klaus said. However, this is sometimes a very useful thing. For example, you can have a group that contains a single text field, behaves like a background, and will therefore appear on many cards, including any new ones you create. This will have the same name on all cards, and you manage that at the card level:
Code: Select all
put "foo" into fld "yourField' of card 20.
Problems usually arise, as Klaus mentioned, when you try to reference two similarly named objects on the SAME card;
Code: Select all
Put "foo" into field "yourField"
In this case, LC will place the text into the field with the lowest layer number. This may not be what you wanted.
If you have these fields on different cards, then the problem is usually not so great, since only the field on the current card will be directly accessible.
Craig Newman
Re: Objects names
thanks all,
ciao
franco
this is something I, absolutely, want to avoid. I only want to copy some objects from a card to a new one, and adapt their scripts.dunbarx wrote: ...
Problems usually arise, as Klaus mentioned, when you try to reference two similarly named objects on the SAME card;
...
ciao
franco
Re: Objects names
Actually, if handled carefully, same names on same card can result in a great deal of efficiency.dunbarx wrote:Problems usually arise, as Klaus mentioned, when you try to reference two similarly named objects on the SAME card;
My response to a different post by Franco gives an example of this strategy.
http://forums.livecode.com/viewtopic.ph ... 78#p108407
Regards,
Sri.
Re: Objects names
Hi Sri,

at the time the terms of the program are slightly different, now I've 1 question at a time and 3 possible answers.... but will be better talk about it in the other topic
Regards, and thanks for your help.
franco
I apologize myself not having responded you in that post you mention above. I missed the mail notificationsritcp wrote:Actually, if handled carefully, same names on same card can result in a great deal of efficiency.dunbarx wrote:Problems usually arise, as Klaus mentioned, when you try to reference two similarly named objects on the SAME card;
My response to a different post by Franco gives an example of this strategy.
http://forums.livecode.com/viewtopic.ph ... 78#p108407
Regards,
Sri.

at the time the terms of the program are slightly different, now I've 1 question at a time and 3 possible answers.... but will be better talk about it in the other topic
Regards, and thanks for your help.
franco