21st Century Man Posted May 15 Posted May 15 Howdy all: For the life of me, I can't figure out how to get this custom function ( https://www.briandunning.com/cf/1943 ) to work. I've attached a rudimentary file where I want to grab the button name and pop it into a global variable. Is the suspect the Get ( ActiveLayoutObjectName ) argument in the calculation, or...? I'm sure it's something simple, just that I'm in Stupid Mode again. : P Thanks, Rich Test.fmp12
comment Posted May 15 Posted May 15 (edited) If I read your file correctly (I only glanced at it) there are at least two issues here: 1. The custom function requires passing the button bar name. Your button bar does not have a name. 2. Even if the button bar had a name, it would not be returned by Get(ActiveLayoutObjectName). Clicking a button bar does not make it the active layout object. That can happen only by tabbing into it. What exactly are you trying to accomplish here? If you want the script to know which button you clicked, you can simply pass the button's name (or any identifying value) as the parameter, without needing all this rigmarole. Edited May 15 by comment Corrected a misconception about timing.
21st Century Man Posted May 15 Author Posted May 15 (edited) I was close--I named the button segments, but not the button. The goal is simple--I just want to grab the name of the clicked button (segment) so it can be passed to a script and be made into a variable. Edited May 15 by 21st Century Man
comment Posted May 15 Posted May 15 2 hours ago, 21st Century Man said: I just want to grab the name of the clicked button (segment) so it can be passed to a script and be made into a variable. And then what? Populating a variable is not a purpose by itself. As I already mentioned, you could simply pass the value of 1, 2 or 3 as the parameter. Then your script will know which button was clicked, without you having to assign object names to them and to the enclosing bar and without an elaborate custom function trying to figure out something which is already known.
21st Century Man Posted May 15 Author Posted May 15 It's for navigation purposes between the many layouts in the database. The idea is that with so many layouts and button bars around, there should be one script to handle all the navigation; by assigning variables to pass to the script it would make it easier to code. That's my logic, anyway....faulty as it may be. : P
comment Posted May 15 Posted May 15 (edited) 1 hour ago, 21st Century Man said: there should be one script to handle all the navigation One script, yes. One parameter, no. But I am not out to convince you against your will. Edited May 15 by comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now