strmem() - Store/Load strings.
ret = strmem( set, name, str ) ret = strmem( get, name )
This function aims to recycle script variables in different scripts. Normally, it is recommended to use wrapper functions getstr() and setstr(). strmem() uses GrADS variable to store script variable. Using strmem() after opening control file is recommended, since GrADS variable is available after opening it. If no control file is opened, strmem() creates dummy control file grads_strmem.dummy.ctl in /var/tmp by default. If you want to change this default directory, change below line in strmem.gsf:
path = '/var/tmp'
The dummy control file sometimes remains in case the script exits abnormally. strmem.gsf cannot run if the dummy file exists, so try the following when you encounter error:
- set or get
- "set" when saving strings, "get" when getting strings.
- Variable name.
- String to be stored.
- Stored string when getting strings ("get").