Remove a SketchCode from the list of files without deleting its file. @see #handleDeleteCode()
(SketchCode which)
| 708 | * @see #handleDeleteCode() |
| 709 | */ |
| 710 | public void removeCode(SketchCode which) { |
| 711 | // remove it from the internal list of files |
| 712 | // resort internal list of files |
| 713 | for (int i = 0; i < codeCount; i++) { |
| 714 | if (code[i] == which) { |
| 715 | for (int j = i; j < codeCount-1; j++) { |
| 716 | code[j] = code[j+1]; |
| 717 | } |
| 718 | codeCount--; |
| 719 | code = (SketchCode[]) PApplet.shorten(code); |
| 720 | return; |
| 721 | } |
| 722 | } |
| 723 | System.err.println("removeCode: internal error.. could not find code"); |
| 724 | } |
| 725 | |
| 726 | |
| 727 | /** |
no test coverage detected