You can do one of this ways or any of the several ways to add this functionality.
in the set button add this code.
and use this line to retrieve the value
str = GetSetting("MyApp","MyForm","DefaultDir","C:\")
or just open a file and save this value and use it.
When you do not get the expected result, change your programming language.