Is it possible to Create a Data Folder using a name contained in a string
Mike German
Is it possible to Create a Data Folder using a name contained in a string.
From a function I want create, kill, change to a data folder with name of data folder contained in a string. Is this possible and if so how?
Mike G
NewDataFolder [/O/S] dataFolderSpec
For dataFolderSpec use $String
NewDataFolder $String
Where String is the name of your string.
July 6, 2020 at 09:03 am - Permalink
Hi Mike,
Short answer: yes
string theName
String What
strswitch (What) // string switch
case "Make": // execute if case matches expression
NewdataFolder $theName
break // exit from switch
case "Kill": // execute if case matches expression
KillDataFolder/Z $theName
break
endswitch
End
I have left the change up to the reader since it requires an additional input.
Andy
July 6, 2020 at 09:08 am - Permalink
In reply to Hi Mike, Short answer: yes … by hegedus
I hoped that would work - I should have had the courage to try it. Just what I needed - thanks!.
July 6, 2020 at 09:38 am - Permalink