How to obtain Button Title

A push button in Pan6 usually has a Button Title assigned to it. Is there any way to determine programmatically what it is?

michael

There is an example of how to do this in Panorama 6 on page 703 of the Formulas & Programming PDF book – assuming that the object name is Signal.

local bTitle
selectobjects objectinfo("name")="Signal"
bTitle=objectinfo("#BUTTON TITLE")
selectnoobjects

In Panorama X this is a bit simpler.

local bTitle
bTitle = objectinfo("Title","Signal")

Just in case we are overlooking the obvious, if the procedure in question was triggered by that button, info("trigger") will return Button.Title where Title is the title of that button. So, if you have several buttons that trigger the same procedure, and your procedure needs to make a decision based on the title, it would just be array(info("trigger"),2,".").

Dave

Should this work with Radio buttons and/or Checkbox buttons?
When I

message info("Trigger")

for those, all I see is “Data Button”. Is there a way to determine which button was clicked?

Thanks,

– Mark

For radio buttons and checkboxes, it returns the object name. If there is no object name, it simply returns Data Button, as you discovered.

Heh! Yeah, I just figured that out. Thanks! :slight_smile:

So – and this is a bit off-topic – is there a way to do “indirection”? IOW, if I have a variable named “Clearance”, is there a way to use that variable as a “pointer” to a field named “Clearance” and retrieve the value of that field?

local lvFieldname, lvFieldvalue
lvFieldname="Clearance"
lvFieldvalue=<value of field "Clearance">

Thanks,

– Mark

Yes, use the grabdata( function.

The new name for gtrabdata( is fieldvalue(. Grabdata( still works, but fieldvalue( is the one that is documented.

I guess since this topic is in the “Classic” category it should be mentioned that fieldvalue( is only for Panorama X and that grabdata( is what would be used for Panorama 3.1.5 through 6.

Oops. I missed that.

You guys are awesome! :smiley:

Thanks for your help.