Editing Programs in Curses UI¶
How to write and edit BASIC programs.
Line-Based Editing¶
BASIC programs are made of numbered lines:
Each line starts with a line number (1-65535).
Adding Lines¶
- Type a line number
- Type your BASIC code
- Press Enter to save the line
Example¶
Editing Existing Lines¶
- Use Up/Down arrows to navigate to the line
- Edit the text
- Press Enter to save changes
Deleting Lines¶
To delete a line, use one of these methods:
Quick Delete (^D)¶
- Navigate to the line
- Press ^D
- Line is deleted immediately
Manual Delete¶
- Navigate to the line
- Delete all text after the line number
- Press Enter
Or type just the line number:
Line Numbering¶
Auto-increment¶
After entering a line, the cursor moves to the next line number (incremented by 10).
Manual Line Numbers¶
You can use any line numbers:
This leaves room to insert lines later.
Cursor Movement¶
| Key | Action |
|---|---|
| Left/Right | Move within line |
| Up/Down | Move between lines |
| Home or ^A | Start of line |
| End or ^E | End of line |
Editing Keys¶
| Key | Action |
|---|---|
| Backspace | Delete before cursor |
| Delete | Delete at cursor |
| Enter | Save line |
Note: Cut/Copy/Paste operations are not available in the Curses UI due to keyboard shortcut conflicts: - {{kbd:stop:curses}} (Ctrl+C) - Used for Stop/Interrupt, cannot be used for Copy - {{kbd:save:curses}} (Ctrl+S) - Used for Save File, cannot be used for Paste (also reserved by terminal for flow control) - Cut would require Ctrl+X which isn't used but omitted for consistency
Workaround: Use your terminal's native clipboard functions (typically Shift+Ctrl+C/V or mouse selection).
Tips¶
- Line numbers can be any value 1-65535
- Common practice: increment by 10
- This leaves room for insertions
- Use A/E if no Home/End keys
See Also¶
- Keyboard Shortcuts - All shortcuts
- Running Programs - Execute your code
- File Operations - Save and load