double id in one stack file ?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

double id in one stack file ?

Post by jmburnod » Wed Apr 29, 2015 9:29 am

Hi All
I read in the doc
"For all objects, the ID is guaranteed to be unique within a stack"
I understand in a stack, not in stack file.
What about substack ?
I noticed that is possible to have an image in a substack with the same id of one other image in the mainstack. (LC 6.7.0)

Is there a way to prevent this ?

Thanks
Jean-Marc
https://alternatic.ch

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

Re: double id in one stack file ?

Post by Klaus » Wed Apr 29, 2015 12:51 pm

Hi Jean-Marc,

yes unique IDs only per (main or sub) stack!

You could put ALL of you images you will ever use in your stack(s) into ONE substack
so there will not be any ID conflict.

That's how I usually do this in my prokects, never had any trouble with missing or
wrong icons in buttons.


Best

Klaus

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: double id in one stack file ?

Post by jmburnod » Wed Apr 29, 2015 1:24 pm

Hi Klaus,
Thanks for confirmation
You could put ALL of you images you will ever use in your stack(s) into ONE substack
Yes that is what I did but in this case the user can import img in a substack
and I stored imgs used as icon in an other.

One cd with img icons in the same substack is probably the best way.
All the best
Jean-Marc
https://alternatic.ch

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: double id in one stack file ?

Post by jacque » Wed Apr 29, 2015 4:28 pm

Change the IDs of your own images to very high numbers, over 100,000. When the user imports images into the other stack they will have much lower numbers and conflicts won't occur.

This only works if your images are in a different stack, as is the case here.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: double id in one stack file ?

Post by jmburnod » Wed Apr 29, 2015 5:52 pm

Jacque,
Thanks one more for help
It is not clear for me
In the doc I'm reading :

* 101,000-103,000: reserved
* 200,000-299,999: reserved for application use

I don't understand "reserved for application use" (MyApp or LC ?)
Best regards
Jean-Marc
https://alternatic.ch

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: double id in one stack file ?

Post by jacque » Wed Apr 29, 2015 6:04 pm

"Application use" is your own stack or app, that range is reserved for developer's use. I also should have said to assign numbers larger than 200,000. I didn't look at the dictionary before replying and forgot the correct range.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply