Duplicate Object IDs with Sub Stack

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
istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Duplicate Object IDs with Sub Stack

Post by istech » Thu Jan 30, 2014 9:32 am

Hi all,

Hope you all can help. I have a main stack and a sub stack which stores 95% of my images.

However I have run into a problem as some of the objects I have added in the main stack have the same IDs as the the sub stack and this is causing problems.

Is there fast/automated way to check if there is any conflicts/duplicate IDs across both stacks? or a fix for this problem?

thanks

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

Re: Duplicate Object IDs with Sub Stack

Post by Klaus » Thu Jan 30, 2014 12:49 pm

HI istech,

what problems are you experiencing?
Duplicate IDs in different stack is normal behavior!

You could script a solution to check the IDs, but maybe this is not neccessary.
But therefore we need to know the problem!

Remember that you can change objects IDs if you really want to, at your own risk of course :D
But that makes sense when it comes to IMAGE ID conflicts!


Best

Klaus

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Duplicate Object IDs with Sub Stack

Post by BvG » Thu Jan 30, 2014 3:15 pm

I suggest to not use ID's in all places where you have a choice. I think the only places where you have to use id's are icons and behaviors.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Re: Duplicate Object IDs with Sub Stack

Post by istech » Fri Jan 31, 2014 12:52 am

Hi,

The problem I have run into is when I import images from a folder into the sub stack and use them as icons in buttons etc in the main stack.

Some of the objects share ids on the main stack so when I reference a image(using a id) from the sub stack I get a main stack image(etc) from time to time.

As I continue moving through the project creating new buttons or players etc this issue can cause problems. Is there a solution for this?

I hope this makes sense. :?

ps. and yes Klaus I have had to change quite a few...of the ones I found :)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Duplicate Object IDs with Sub Stack

Post by FourthWorld » Fri Jan 31, 2014 2:42 am

IDs are settable. Tedious, but you could change the ID values from the ones they were imported with to make them unique across your project.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Re: Duplicate Object IDs with Sub Stack

Post by istech » Fri Jan 31, 2014 9:23 am

Thanks Richard,

Yes this has been the case. Just checking to see if there was any other faster method.

I suppose it would be nice to see all the IDs in the application browser under a separate column. I could then do a sort and see if there are any duplicates among the stacks.

In any case thanks for your replies.

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Duplicate Object IDs with Sub Stack

Post by BvG » Fri Jan 31, 2014 1:20 pm

Ah i see, an image library substack. One way that I made work before is to set the id of the substack to a high value, for example I tend to use 300000. That way, all id's of new objects will start from there, which reduces the likeliness of conflicts.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Re: Duplicate Object IDs with Sub Stack

Post by istech » Mon Feb 03, 2014 9:40 am

Yes in fact I started to do this and made it 500 away from my main stack IDs.

In the end it was no way enough looks like IDs 30k and above is the option. :D

Post Reply