Object search-and-list
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Object search-and-list
My Devawriter Pro source stack is about 14 years old, and I suspect it has become a bit 'clunkified' owing to the presence of several heay images hidden away in the 'undergrowth'.
I wonder if there is a way to find the names of all the images both in the main stack, and in its subordinate substacks and pop them into a field along with their IDs . . .
Weeding between the tomatoes, although tough on my back, seems easier than delving through all layers of each card (about 50) in my mani stack, and then the same in the substacks.
I wonder if there is a way to find the names of all the images both in the main stack, and in its subordinate substacks and pop them into a field along with their IDs . . .
Weeding between the tomatoes, although tough on my back, seems easier than delving through all layers of each card (about 50) in my mani stack, and then the same in the substacks.
-
- Livecode Opensource Backer
- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Re: Object search-and-list
This is, frankly hilarious:
- -
It finds 35 images.
As my Devawriter Pro stack must contain something of the order of 3000 images.
-
- -
It finds 35 images.
As my Devawriter Pro stack must contain something of the order of 3000 images.
-
-
- Livecode Opensource Backer
- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Re: Object search-and-list
Ah:
So, LC cannot list objects in a stack without flipping through the cards. 
Code: Select all
on mouseUp
put empty into fld "fPIX" of stack "Object Search"
put the number of cards in stack "DWPro" into QQQ
put 1 into RRR
put 1 into SSS
repeat until RRR > QQQ
go to card RRR of stack "DWPro"
put the number of images of card RRR of stack "DWPro" into XXX
put 1 into ZZZ
repeat until ZZZ > XXX
put (RRR & "/" & ZZZ) into line SSS of fld "fPIX" of stack "Object Search"
add 1 to ZZZ
add 1 to SSS
end repeat
add 1 to RRR
end repeat
end mouseUp

-
- Livecode Opensource Backer
- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Re: Object search-and-list
HOWEVER, while the object counter stack is flipping through the cards of my Devawriter Pro stack it "falls over" code inwith the DWPro stack:
Basically 'screwing up' over OpenCard messages.
The object counter stack should be able to flip through the stack it is searching WITHOUT any scripts in the stack being searched activating at all.
- -
So my next question is how one can disable the code in the stack that is being searched, but not in the stack doing the searching.
i.e. suppress messages in the stack that is being searched, but not in the stack doing the searching.
This is not working:
-
Basically 'screwing up' over OpenCard messages.
The object counter stack should be able to flip through the stack it is searching WITHOUT any scripts in the stack being searched activating at all.
- -
So my next question is how one can disable the code in the stack that is being searched, but not in the stack doing the searching.
i.e. suppress messages in the stack that is being searched, but not in the stack doing the searching.
This is not working:
-
-
- Livecode Opensource Backer
- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Re: Object search-and-list
OK, OK: that 'accidentally' turned up a bug in my Devawriter Pro stack (for which I am duly grateful), but there SHOULD be a way to LOCK all messages in a stack being searched.
AND . . . the substacks . . .
AND . . . the substacks . . .
-
- Livecode Opensource Backer
- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Re: Object search-and-list
So: to list a stack's substacks is no big thing, but to open them apparently is:
- -
Line 14 throws a complete bluey.
- -
Line 14 throws a complete bluey.
-
- Livecode Opensource Backer
- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Re: Object search-and-list
This works (unless the stack being searched has an in-built answer dialog substack):
- -
- -
- Attachments
-
- Test.livecode.zip
- Stack.
- (102.91 KiB) Downloaded 80 times
-
- Object Search.livecode.zip
- Stack.
- (6.59 KiB) Downloaded 78 times