Object search-and-list

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
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Object search-and-list

Post by richmond62 » Tue Jul 09, 2024 9:25 am

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.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Object search-and-list

Post by richmond62 » Tue Jul 09, 2024 9:42 am

This is, frankly hilarious:
-
Screenshot 2024-07-09 at 11.38.32.jpg
-

It finds 35 images.

As my Devawriter Pro stack must contain something of the order of 3000 images.
-
61KgLUP4fXL._AC_UF1000,1000_QL80_.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Object search-and-list

Post by richmond62 » Tue Jul 09, 2024 9:50 am

Ah:

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
So, LC cannot list objects in a stack without flipping through the cards. :(

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Object search-and-list

Post by richmond62 » Tue Jul 09, 2024 9:54 am

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.
-
Screenshot 2024-07-09 at 11.51.36.jpg
-
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:
-
Screenshot 2024-07-09 at 12.14.46.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Object search-and-list

Post by richmond62 » Tue Jul 09, 2024 10:40 am

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 . . .

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Object search-and-list

Post by richmond62 » Tue Jul 09, 2024 11:08 am

So: to list a stack's substacks is no big thing, but to open them apparently is:
-
Screenshot 2024-07-09 at 13.06.37.jpg
-
Line 14 throws a complete bluey.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Object search-and-list

Post by richmond62 » Tue Jul 09, 2024 2:45 pm

This works (unless the stack being searched has an in-built answer dialog substack):
-
Screenshot 2024-07-09 at 16.41.41.jpg
-
Attachments
Test.livecode.zip
Stack.
(102.91 KiB) Downloaded 79 times
Object Search.livecode.zip
Stack.
(6.59 KiB) Downloaded 78 times

Post Reply