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!
I have a question about deleted objects from livecode file. All the objects that i have deleted from my project long time ago i can see now as for example "bkgn group "player" of stack "stackName" " and all the objects from all this time, could be button, substack and so on, with their codes inside. i have about 2003 deleted objects in search result. Can you please give me a solution? i deleted objects using
The only thing that will prevent a "delete" command from working is if the command is invoked with a running script in the object in question. How are you searching for these objects?
If I make a card with a few controls on it, and delete some, they are gone. Can you make a test stack where they are not?
dunbarx wrote: How are you searching for these objects?
Hi, thanks for reply
I am searching some function that was in deleted objects and it brings that object code. i am attaching a file, as you see it is 772kb but has only one button on it, and if you try to search in the script "get" or something else that can be in my code (ctrl+shift+F) it will go trough many controls and bring their code.
Hi Astghik and Craig
Thanks for this example.
I have got it.
I believe that is happened during an update.
We discuss it in this thread but we haven't found a solution except
cleaning cd per cd in a new stack. Craig Do you remember ? http://forums.livecode.com/viewtopic.php?f=8&t=24228
Best regards
Jean-Marc
Thanks for providing the stack. The groups in question were apparently removed but not deleted, resulting in having them present in the stack file but not placed on any card. This prevents them from being visible in the Project Browser, but you'll find them listed in the IDE's Object menu under the Place Groups submenu.
Tedious solution: place each one manually and manually delete it.
Faster solution: write a quick script to delete them, e.g.:
on mouseUp
put the backgroundIDs of this stack into tList
repeat for each line tID in tList
set the cantdelete of bg id tID to false
delete bg id tID
end repeat
end mouseUp
Saving after running that brought the stack file size down to 3.7k.
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Can this be said to be an unflattering "feature" of the group paradigm, that would never have reared its head in HC with its single backGround object class? It is at least something to be aware of. When working on several versions of stacks with the same name, I always get caught with the dialog that asks me if I want to purge the current one. One might say that the extra effort to set the destroyStack property to "true" hardly qualifies as onerous, but it is also something to be aware of.
Can this be said to be an unflattering "feature" of the group paradigm, that would never have reared its head in HC with its single backGround object class? It is at least something to be aware of.
IMO the latter. Just about any feature in any language can be used to shoot yourself in the foot. Here the rule isn't hard to remember: if you want to delete a group, delete it; if you want to remove it from a card but keep it in the stack for later use, remove it.
When working on several versions of stacks with the same name, I always get caught with the dialog that asks me if I want to purge the current one. One might say that the extra effort to set the destroyStack property to "true" hardly qualifies as onerous, but it is also something to be aware of.
On that one my preference would be to replace the name "destroyStack" with something that's not unnecessarily scary (it doesn't actually delete the stack) so people would actually use it.
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Thanks All,
That is clearer for me now.
I wonder if we can use the owner to know if a group is placed on a cd or not
The owner of a placed group is an other group or a card.
If a group is not placed on a cd or in an other group placed on one cd LiveCode return an error "can't find background".
It means that is a good way to delete groups which are not placed on one cd ?
Best regards
Jean-Marc
on mouseUp
put the backgroundIDs of this stack into tList
repeat for each line tID in tList
set the cantdelete of bg id tID to false
delete bg id tID
end repeat
end mouseUp
Saving after running that brought the stack file size down to 3.7k.
I get an error message "can't find background" for the owner of a group unplaced on a cd
Confirmed here. The "owner" lives only in stacks. So does "exists", which throws the same error that Jean-Marc noted. And the owner of a mainstack is always empty.
Is there any analog for the stack file? There must be, because as Richard points out, LC "knows" about unplaced groups, since they are listed in the "Place group" menu, and it is a snap to re-place them.
@AstghikM. That must have been some list if you had 2000 unplaced groups.
Hello everyone,
I just noticed another problem, when i copy some object or group of objects on one card, in that card "Objects/Place Group" is empty, but when i am on another card, where i did not copy the objects "Objects/Place Group" has the list of the objects, and if i place the objects and delete it will say that i have that objects in multiple cards, and if i delete the objects i will lost all, because the IDs are the same. so that is how i got a huge list of objects.
Thanks