somewhere on this website there is a compendium of neat little programs. It is called "Useful extra components". From that sheet I've got this little helper (see attached file) that writes out data to a text file only on demand.
Finally I am creating a vb.net application with good UI, which takes file path as input and writes all parameters to text file as needed. In this case i need to list all the parameters names to get its values
You can cheat by using the MathRegion XML export API in VBscript. This will, with a little care show you all the defined variables, the maths expressions, and results. You have to decode the XML though.
At the moment I'm doing it for a file compare function but it's not finished yet.