Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
private void addProject(str newProject)
// add a new project to the list.
Array projects;
int i;
projects = this.getProjectList();
// make sure it's not already there...
for (i=1; i <= projects.lastIndex(); i++)
if (projects.value(i) == newProject)
// add it and save.
projects.value(projects.lastIndex()+1, newProject);
private void removeProject(str projectToRemove)
// remove a project from the list.
Array projectsIn, projectsOut;
int i, j;
projectsIn = this.getProjectList();
projectsOut = new Array(Types::String);
for (i=1; i <= projectsIn.lastIndex(); i++)
if (projectsIn.value(i) != projectToRemove)
projectsOut.value(j, projectsIn.value(i));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment