Created
April 5, 2013 00:05
-
-
Save andyhuey/5315547 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
return; | |
} | |
// add it and save. | |
projects.value(projects.lastIndex()+1, newProject); | |
this.writeProjectList(projects); | |
} | |
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); | |
j=1; | |
for (i=1; i <= projectsIn.lastIndex(); i++) | |
{ | |
if (projectsIn.value(i) != projectToRemove) | |
{ | |
projectsOut.value(j, projectsIn.value(i)); | |
j++; | |
} | |
} | |
this.writeProjectList(projectsOut); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment