In the past it's happened that for some reason I still haven't figured out my variables got wiped. So I actually use a combination of both. On some scripts, I will store settings in variables until I quit mirc, then I write them to file, and on other scripts I'll write them to file when the dialog closes. The sooner you write em to file, the less chance there is of something happening to them. Although in the end the chance is very smll.