How do I convert a DFREF (data folder reference) to a string?

How can I convert a DFREF to a string for user interaction?

Function Test(dfr)
    DFREF dfr 
    Display dfr:wave0                           // OK
    if ((DataFolderRefStatus(dfr)==0)
        // invalid
        abort "invalid data folder reference was passed: "
    endif
    return 1
End

 

GetDataFolder allows to convert a DFREF into a string. But in you case the DFREF will be invalid so the string is rather not interesting or?
 

Thank you, I did not see this application when looking at

displayhelptopic "Data Folder References"

In my current application it will be useful when iterating, to identify the source of a problem.