Page 1 of 1

How do I generate a list of objects used in a stack?

Posted: Wed Dec 09, 2009 11:21 am
by arombauts
Hello all!

I would like to get a list of objects used in a stack. What would be the script?...

Thanks in advance...

Re: How do I generate a list of objects used in a stack?

Posted: Wed Dec 09, 2009 11:36 am
by bn
Hi arombauts,
look at control

Code: Select all

put the number of controls 

Code: Select all

put the name of control 1

Code: Select all

put the number of controls of card 1
regards
Bernd

Re: How do I generate a list of objects used in a stack?

Posted: Wed Dec 09, 2009 4:09 pm
by arombauts
Thanks a lot!

Re: How do I generate a list of objects used in a stack?

Posted: Wed Dec 09, 2009 6:31 pm
by dunbarx
You can write something like:

Code: Select all

on mouseup
   repeat with y = 1 to the number of controls
      put the number of control y && the name of control y into line y of temp
   end repeat
   answer temp
end mouseup

Re: How do I generate a list of objects used in a stack?

Posted: Wed Dec 09, 2009 6:32 pm
by dunbarx
You can also download the "wizard" stack from revOnLine

Re: How do I generate a list of objects used in a stack?

Posted: Wed Dec 09, 2009 7:33 pm
by arombauts
Thanks all. Very easy indeed, as everything in RunRev...

Code: Select all

   put "Crd" & tab & "Ctrl ID" & tab & "Type" & tab & "Name" & return into field Display
   repeat with crd = 1 to the number of cards of this stack
      repeat with ctrl = 1 to the number of controls of card crd
         set the itemdelimiter to " "
         put crd & tab & the ID of control ctrl & tab & item 1 of the name of control ctrl & tab & item 2 of the name of control ctrl & return after field D
      end repeat       
   end repeat

Re: How do I generate a list of objects used in a stack?

Posted: Wed Dec 09, 2009 9:15 pm
by Mark
Hi arombauts,

You might also like these handlers.

Best,

Mark

Re: How do I generate a list of objects used in a stack?

Posted: Thu Dec 10, 2009 12:08 am
by lohill
Here is a correction to arombats code to make it run:

Code: Select all

on mouseUp
       put "Crd" & tab & "Ctrl ID" & tab & "Type" & tab & "Name" & return into field "Display"
   repeat with crd = 1 to the number of cards of this stack
      repeat with ctrl = 1 to the number of controls of card crd
         set the itemdelimiter to " "
         put crd & tab & the ID of control ctrl of card crd & tab & item 1 of the name of control ctrl of card crd & \
         tab & item 2 of the name of control ctrl of card crd & return after field "Display"
      end repeat       
   end repeat
end mouseUp   
It also works nicely if field "Display" is a table field rather than a regular field.

Just trying to learn.
Larry