How to get Function/Command/Handler name

New to Eggplant

I need to return the self created Function/Command/Handler name

I know that you can use the following to return the Suite/Script but, I need the Function/Command/Handler running inside the Script.

Put SuiteInfo.name & "/" & my name & into myInfo

log myInfo

Gives me the Suite/Script info but, for Example if I have the following Function I need to return function name, "myFunction" as "Suite name/Script name/myFunction"

Function myFunction

Put SuiteInfo.name & "/" & my name & "/" & into myInfo

log myInfo

end myFunction

also need it to work for Command

to myCommand

Put SuiteInfo.name & "/" & my name & "/" & into myInfo

log myInfo

end myCommand

I've tried the following:

param(0)

CallStack()

my caller

Thanks for any help in advance

wtwynn


Any takers =) I still haven’t found a solution.

Put SuiteInfo.name & “/” & my name & “/” & param(0) into myInfo works when you call a Function or Command but it doesn’t when you highlight and run the code inside the Function. When you run the code highlighted inside the Function returned is “SuiteName.suite/ScriptName.script/ScriptName”

1 Like

When you select the contents of a handler, you’re stripping off the declaration of the handler. All the ST engine knows is that it’s running some code from the script file, so that’s all it can report. There is no way that you can get the handler name in that scenario. The handler only exists when it is called as a handler.

Matt, thanks for the explanation.