Back to the main page.

Bug 1291 - consider to use addpref/getpref instead of the global ft_default

Status CLOSED WONTFIX
Reported 2012-01-25 22:40:00 +0100
Modified 2019-08-10 11:55:36 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: All
Importance: P3 enhancement
Assigned to:
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2012-01-25 22:40:54 +0100

I noticed in the MATLAB 2011b documentation ----------------------------------------------------------------- addpref('GROUP','PREF',VAL) creates the preference specified by GROUP and PREF and sets its value to VAL. It is an error to add a preference that already exists. ... Preference values are persistent and maintain their values between MATLAB sessions. Where they are stored is system dependent. Example: addpref('mytoolbox','version',1.0) ----------------------------------------------------------------- At the moment we use the ft_defaults function which uses the ft_default (without "s") global variable that is mingled with the cfg in ft_checkconfig. This MATLAB pref handling seems to be a more appropriate way to deal with preferences. An important aspect would be to check how this plays with older MATLAB versions


Robert Oostenveld - 2012-01-26 20:28:17 +0100

I have checked: the functions already exist in matlab version 7.0 from 2004, which is older than what we would consider supporting (http://fieldtrip.fcdonders.nl/code_guidelines?&#ensure_that_it_runs_on_older_matlab_versions). So backward compatibility is not an issue.


Jan-Mathijs Schoffelen - 2012-09-19 14:43:02 +0200

discussed in FT-meeting: this has very low priority (i.e. very light grey). Probably this behaviour is not what users expect.


Robert Oostenveld - 2019-08-10 11:51:39 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on https://github.com/fieldtrip/fieldtrip/issues.


Robert Oostenveld - 2019-08-10 11:55:36 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on https://github.com/fieldtrip/fieldtrip/issues.