dfr2str
pb
Presently users can implement something along the lines of the following:
Function dfr2str(dfr)
DFREF dfr
String dfstr
DFREF initialFolder = GetDataFolderDFR()
SetDataFolder dfr
dfstr = GetDataFolder(1)
SetDataFolder initialFolder
return dfstr
End
DFREF dfr
String dfstr
DFREF initialFolder = GetDataFolderDFR()
SetDataFolder dfr
dfstr = GetDataFolder(1)
SetDataFolder initialFolder
return dfstr
End
However, this is a sort of silly way to perform a task that is probably worthy of being built-in to Igor. Also, it'd be nice if it supported various output modes (similar to GetDataFolder). I'm conflicted about how it should handle invalid DFREF's; perhaps there should be yet another (optional?) parameter for permitting an invalid ref -- otherwise, by default, the function returns a null string.
Actually, it might not be a bad idea to replicate this sort of function for S/NVARS. Come to think of it, I could envision one all-encompassing function like "GlobalRef2str" that will take any global reference as input and spit out a string. Maybe this is a better approach.
Nick
April 9, 2010 at 01:13 pm - Permalink
April 9, 2010 at 02:09 pm - Permalink