Multi-file programs allow programs to combine code from multiple files in order to run. Currently this is available for HTML programs within CodeHS courses, and for Java programs in the CodeHS Sandbox IDE.
About Files in Multi-File Programs
All programs have a main file. This file has the play symbol next to it and cannot be deleted or renamed.
Some programs require specific files in order to run. A good rule of thumb is that if a program comes with files already in place, you should not rename or delete them. If you need additional files, you can always add more!
Please note that files cannot be deleted or renamed while students are using blocks.
Creating a New File or Folder
To create a new file or folder:
- At the top of the file navigation pane, click New +
- Choose File or Folder
- Enter the name for your new file or folder and click Add Folder or Add File
If you choose to add a new file, remember to include the extension (.html, .java, etc.)
Renaming a File
To rename a file, click the down arrow next to the file name and choose Rename. Enter the new file name and click Save.
Deleting a File
To delete a file, click the down arrow next to the file name and choose Delete. Click OK to confirm that you want to delete the file.
Recovering Deleted Files
If you delete a file by mistake, it can be recovered in the History tab in your code editor.
- Go to More > History
- Select the timestamp you'd like to go back to
- Click Restore from Snapshot
Still have questions? Contact our team at email@example.com to learn more!