Onesimus Posted April 12, 2005 Share Posted April 12, 2005 Is there a way of deactivating a button when it is pressed and peformed its script - and automatically reactivating the same button when a user returns to the layout that that button was on? In essence, I only want that button to perform its script only once when it is on that layout - and to be deactivated if that button is pressed further. Leaving that layout then returning to the layout reactivates that button. Onesimus Link to comment Share on other sites More sharing options...
aaa Posted April 12, 2005 Share Posted April 12, 2005 Do anything like this:(may be this help you) Create one global field "Pressed" In script for button do like this: Allow user abort off If (not Pressed) Pressed=1 Perform script ......... Pressed=0 Endif Link to comment Share on other sites More sharing options...
Onesimus Posted April 12, 2005 Author Share Posted April 12, 2005 Thanks for your response, aaa - but how do you introduce variables into scripts e.g. Pressed=1, Pressed=0, etc? Onesimus Link to comment Share on other sites More sharing options...
aaa Posted April 12, 2005 Share Posted April 12, 2005 Set Field[Pressed,1] Set Field[Pressed,0] Link to comment Share on other sites More sharing options...
Onesimus Posted April 12, 2005 Author Share Posted April 12, 2005 Thanks again, aaa - will try your latest suggestion! Onesimus Link to comment Share on other sites More sharing options...
volkerimmler Posted April 28, 2005 Share Posted April 28, 2005 another way might be to have two identical layouts - one with the button...one without... if the user presses the button - you perform your script and switch to the layout without the button.... you can even put a 'greyed out' version of your button on the second layout... Link to comment Share on other sites More sharing options...
Maarten Witberg Posted April 28, 2005 Share Posted April 28, 2005 adding to aaa's suggestion, using container fields, you can make custom buttons look pressed and active. store the buttons in a global repeating container gButtons Script1Button=calc, container result=case(pressed=1;GetRepetition(gButtons;1);GetRepetition(gButtons;2)) then define this container field as the button that calls your script. You can use gButtons to store more buttons (pressed-unpressed, sent-received-read, trash-save, whatever) that are set by different calcs, Script2Button Script3Button etc. kjoe Link to comment Share on other sites More sharing options...
FileMakin' Tom Posted April 29, 2005 Share Posted April 29, 2005 OH COME ON! The visibility routine is now old news - Simply create a relationship and portal which when a condition is met, the button (or whatever) appears (or changes state) on the layout. When the condition is not met, the button (or whatever) simply disappears (or changes state). Rather elementary, Watson. If you need a sample of how this is done, email me at fmguru@tampabay.rr.com and I can send you about a million little files illustrating the technique. So, if one returns to the first layout, then the script simply reverses the relationship and VOILA - the button is back to its original state. Really quite simple - and no convoluted calcs needed. Tom Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.