Forum Discussion

EnTerr's avatar
EnTerr
Roku Guru
9 years ago

ifFunction.getName(), pls?

@Roku* - can we please get a way to obtain function's name?

Something like .getName() - and concurrently (or alternatively) .toStr() to return a string with the name included. As in:
Brightscript Debugger> ? main
<Function: main>

Brightscript Debugger> ? main.toStr()
<Function: main>     'hypothetical, currently just says: Function '

Brightscript Debugger> ? main.getName()
main       'hypothetical

The specific use case is to be able to set function names in RSG fields, like Task.functionName. I know this is ass-backwards as it gets - but this is how RSG currently is - not supporting function type fields.

In addition, such retrospection would help with building test tools (being able to verify results). And in general i am thinking .toStr() should be defined for all data types to return a string that is as close to the PRINT output as possible.

2 Replies

  • RokuKC's avatar
    RokuKC
    Roku Employee
    "EnTerr" wrote:
    @Roku* - can we please get a way to obtain function's name?

    Something like .getName() - and concurrently (or alternatively) .toStr() to return a string with the name included.Brightscript Debugger> ?


    I thought this had been discussed already, but at any rate, feature requested noted: πŸ™‚
  • "RokuKC" wrote:
    I thought this had been discussed already, but at any rate, feature requested noted:  πŸ™‚

    Thanks!
    I was just reminded by this additional use case - RSG - for which the Co may care more.
    My previous musings on introspection were regarding test suites, which is supplementary to prime business.