Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get properties of a variable object at runtime

Status
Not open for further replies.

Jakyll

Programmer
May 4, 2012
3
Hi,
New to Powerbuilder... I am trying to do something like this... I need to access a command buttons properties at runtime, but I won't know which one until it's clicked and a function is triggered ( myFunction(this.ClassName) ) ... I'm a C# programmer and don't know how to do this in PB

(in Pseudocode)
string myButton = "cb_1"
string result = ""

result = w_1.ControlsCollection(myButton).Text

I know there isn't such a thing as 'ControlsCollection' but I hope you understand my meaning... Any tips would be great! Thank you in advance.
 
Search PB help for the CREATE statement.

You could do something like this:
Code:
commandbutton lpo
string ls

ls = 'cb_1' // name of a commandbutton on the window

lpo = CREATE USING ls

messagebox('class',lpo.Text)

Matt



"Nature forges everything on the anvil of time"
 
Not exactly what I needed but helpful none the less thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top