The code to save the LRU of the last projects used is something like this:
static void saveLastProjects()
{
_str lastProjectsStr;
_ini_get_value(VSEWorkspaceStateOLDFilename(), "LastProjects", "Global", lastProjectsStr);
_str lastProjects[];
split(lastProjectsStr, ",", lastProjects);
int i;
int foundAt = -1;
for(i=0; i<lastProjects._length(); ++i) {
if (lastProjects[i] == _project_name) {
foundAt = i;
break;
}
}
// Bring element to front.
if (foundAt >= 0) {
lastProjects._deleteel(foundAt);
}
// Insert at front.
lastProjects._insertel(_project_name, 0);
// Save new (LRU'd) state.
lastProjectsStr = join(lastProjects, ",");
_ini_set_value(VSEWorkspaceStateOLDFilename(), "LastProjects", "Global", lastProjectsStr);
}
And I read it back via:
_str lastProjectsStr;
_ini_get_value(VSEWorkspaceStateOLDFilename(), "LastProjects", "Global", lastProjectsStr);
_str lastProjects[];
split(lastProjectsStr, ",", lastProjects);
Works with the old methods, but somehow fails (produces empty lastProjects array) with the new.
Chances are I messed something up :-)
Thanks for taking a peek!