How to obtain Button Title


#1

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

michael


#2

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")

#3

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


#4

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


#5

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


#6

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


#7

Yes, use the grabdata( function.


#8

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


#9

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.


#10

Oops. I missed that.


#11

You guys are awesome! :smiley:

Thanks for your help.