Stack name conflicts resolved?
ahsoftware at sonic.net
Sun Nov 6 17:57:58 CET 2016
On 11/05/2016 09:38 PM, Monte Goulding wrote:
>> On 6 Nov. 2016, at 1:31 pm, Mark Wieder <ahsoftware at sonic.net> wrote:
>> When new stacks are created in memory they are assigned the id 1002.
>> If there's a stack already in memory why not create the new stack with the next sequential id?
>> Then the combination of id and filename should uniquely identify a stack.
> Stack IDs aren’t really IDs at all they are just the max ID in a stack + 1. The first 1000 IDs are reserved. Card 1 is 1001 and therefore a new stack ID is 1002. Create a new object and the ID changes.
Yes, good point, but here's the thing:
Create two new stacks.
They both have the "ID" 1002.
Set the id of the second stack to 3000.
Now you have stacks 1002 and 3000.
Add a button to each stack.
The stack ids are now 1003 and 3001.
They're obviously different stacks.
You see two stacks on the screen, they have different ids.
Now rename the second stack to "Untitled 1"
The property inspector allows this, but now gets very confused.
If you try to bring up the property inspector of either stack, you get
only the first one it comes across, until you rename one.
I'd prefer the creation timestamp as a unique identifier for stacks, but
whatever we use, the short name by itself is inadequate to the task.
ahsoftware at gmail.com
More information about the use-livecode