Saving a struct to a data folder

Hi there!

I am interested in saving a struct to a data folder. For a string, I *can* do:

        NewDataFolder/O/S $"root:Folder"
    String root:folder:str = "foo"


Is there something analogous for structs? I'ver tried the following with no success:

        Structure StructA
              Variable foobar
        EndStructure

        NewDataFolder/O/S $"root:Folder"
    Struct root:folder:StructA bar // "No Such Structure Exists"
        Struct StructA root:folder:bar // "Expected ";" or <cr>"


If not, are there any alternatives? One seems to be to just use waves,strings, and variables, but I'm trying to be organized for a large run of independent data sets, so a struct seemed natural.

Thanks!
It seems not to be possible in Igor 6:
displayhelptopic "Limitations of Structures"
"A structure variable, like all local variables in functions, disappears when its host function returns. In order to maintain state information, you will need to store and retrieve structure information using global variables."

I also miss this feature ...
HJ
You can save/retrieve the contents of structures containing only numeric data with StructPut and StructGet. As the previous reply implies, the data are saved in a special format to a wave or string variable, but not as a Struct type.

Read the help info for StructPut for details to see if this fits your case.
Hand-coding a store and load routine for exactly your struct is also feasible if it has only a few members.
Thanks for the comments! I'm sad to hear this isn't possible; it looks like my best bet is (unfortunately) to create custom functions to load and store the struct, since my struct isn't just numeric types.

EDIT 6/9/15: It didn't occur to me that you can store strings as numeric types by using character arrays (see http://www.igorexchange.com/node/6528, or look at The "WaveSelectorListInfo" Structure in "WaveSelectorWidget". I will probably refactor my existing code to make this work. Thanks again