Card id and button problem

Lars Brehmer lbrehmer at rof.net
Tue Jun 29 16:31:49 EDT 2004


Hi All!

I've been searching searching the archives for hours, but since I don't 
really know what I'm doing, I guess I don't know what to search for!  
Here's the problem/question:

I have a stack with a substack drawer.  When a new card is created in 
the main stack, there is a button on it that creates a new card in the 
substack, unlocks its text fields and opens it in the drawer.  The 
button in the main stack that created the new card in the substack is 
then hidden behind another new button that should later open the drawer 
to that same card.  Once the fields on the drawer card are filled in, 
there is a button on it that locks the fields and saves the drawer 
stack.  The problem is that I need that save button also to put the 
short card id of the drawer card into the script of the main stack 
button that will re-open it.   This is what I can't figure out.  It 
looks like this:

the button that creates the new card in the drawer stack looks like this

   open stack "buttons"   --  this is a substack that contains the 
buttons I use
   copy btn id xxxx to stack "MainStack"  -- this is now in front of 
(and thus hides) the "new card" button
   close stack "buttons"
   open stack "Y"  -- this is the drawer stack
   create card
   repeat with i = 1 to 33
     set the lockText of field ("Field" & i) to false
   end repeat
   close stack "Y"
   drawer stack "Y" at bottom aligned to center -- this reopens the "Y" 
stack in the drawer


The new drawer card is now open and the fields can be filled in.  The 
save button on this card is:

   repeat with i = 1 to 33
     set the lockText of field ("Field" & i) to true
   end repeat
   save stack "Y"
   close stack "Y"

So far it all works.  The button on the main stack card that should 
lead back to this drawer card is:

   drawer stack "Y" at bottom aligned to center
   go card id zzzz of stack "Y"

Is it possible to take the short id of the new drawer card and put it 
in place of the zzzz in the button script on that specific card in the 
main stack? This is what I don't know how to do.

Suggestions?

Thanks,


Lars









More information about the use-livecode mailing list