File Operations in Curses UI¶
How to save and load BASIC programs.
Saving Programs¶
- Press {{kbd:save:curses}} to save (Ctrl+S unavailable - terminal flow control)
- Status line prompts: "Save as: _"
- Type filename (e.g.,
myprogram.bas) - Press Enter
- Status shows: "Saved to myprogram.bas"
Tips¶
- Include
.basextension (recommended) - Use relative or absolute paths
- If file exists, it will be overwritten
- If save fails, error shows in status line
Example¶
Loading Programs¶
- Press {{kbd:open:curses}}
- Status line prompts: "Load file: _"
- Type filename
- Press Enter
- Program loads into editor
What Happens¶
- Current program is replaced (not merged)
- Parse errors shown in output window
- Successfully loaded lines appear in editor
- Status shows: "Loaded from filename.bas"
Example¶
Loading from Command Line¶
You can also load a program when starting:
The program will: - Load into the editor - Enter interactive mode (ready to run with {{kbd:run:curses}})
Creating a New Program¶
- Press {{kbd
curses}}
- Confirms: "Program cleared"
- Editor is empty, ready for new program
Warning: This clears the current program! Save first if needed.
File Format¶
Programs are saved as plain text:
Each line must start with a line number.
Troubleshooting¶
"File not found" Error¶
- Check filename spelling
- Check file exists in current directory
- Try absolute path:
/home/user/programs/test.bas
"Parse error" Messages¶
- Some lines may have syntax errors
- Errors shown in output window
- Valid lines still load
- Fix errors and re-save
Can't See Filename Prompt¶
- Look at bottom status line
- It says "Save as: " or "Load file: "
- Type filename there
- If error message is showing, press ESC first