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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I use a "TriggerFunction"?

Status
Not open for further replies.

Lekar

Programmer
Sep 7, 2001
85
CR
Hello everybody!

I wanna trigger a function on a control based on the argument passed to of_Edit_Action function.

Public Function Long of_Edit_Action(ReadOnly String as_Action)
/*
The as_Action variable can hold values like "copy", "cut", "paste", "clear"
*/
/* Before runnig this sentence, I validate that the control
has the function specified on as_Action, declared in its class definition */
If Not of_Function_Exists(... /* I know how to do this! */

/* But, then, I want to do something like this: */
GetFocus().TriggerFunction(as_Action)
End Function

My question is:
Is it possible to do something like that?

Thanks in advance.
 
There is no way to 'silently' trigger a function as we do with events (without arguments); we need to have its name at design-time although they can be dynamically invoked at runtime in a generic way. There is NO TriggerFunction() in PowerScript! You could declare it as an event instead of a function.

If the function you are trying to invoke is already defined in the GraphicObject, you may do:

GetFocus().DYNAMIC FunctionName( ... )

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top