>>If Mark's idea was to dump variables into a text file of some sort just for debugging purposes, then List Status is the way. Save/Restore is just plain dirty IMO, and very risky. It may have unexpected effects.
>
>I agree with your points (especially the prefixing stuff). But it is also astonishingly fast if you have complex array structures in need of persistence - it is also an arrow to keep in mind for interprocess communication if large amounts of data need to be exchanged. "Dirty" is not always bad (and never if WE do it <bg>).
Just today I've found a bit of code where I had a bunch of g_* prefixed variables (in my old DOS code that I'm converting) in a .mem file, and it read them from the file, saved again into a memo in a temp cursor, then stuffed them in name-type-value triplets into an array:
rest from g_var
save to memo mm
n=occu('G_',mm)
dime var(n,3)
set text on
for u=1 to n
gdev=at('G_',mm,u)
gcut=subs(mm,gdev,16)
gname=left(gcut,at(chr(0),gcut)-1)
gtype=subs(gcut,12,1)
var(u,1)=Proper(gname)
var(u,2)= gtype
var(u,3)=eval(gname)
endf
Then I used this array to generate a .prg which'd have all these variables set as globals. But that's pretty much the only place where I used the Save command.
I agree, if you know the dangers and know how to apply proper limits, Save/Restore may be the tool of choice for some situations.
To Tore: see, it's not encrypted, just somewhat binary :).