72 lines
2.0 KiB
Markdown
72 lines
2.0 KiB
Markdown
|
# Command Processor Form (Cmdproc-3.frm)
|
||
|
|
||
|
## Overview
|
||
|
The Command Processor form provides a user interface for executing and managing commands in the application. It handles command input, processing, and output display.
|
||
|
|
||
|
## Form Components
|
||
|
|
||
|
### Text Areas
|
||
|
- **Command Input Box**: Multi-line text box for entering commands
|
||
|
- **Output Display**: Large text area showing command execution results
|
||
|
- **Status Bar**: Displays current status and error messages
|
||
|
|
||
|
### Buttons
|
||
|
- **Execute**: Runs the entered command
|
||
|
- **Clear**: Clears both input and output areas
|
||
|
- **History**: Shows previous command history
|
||
|
|
||
|
## Key Functions
|
||
|
|
||
|
### ProcessCommand()
|
||
|
Processes the entered command string and executes corresponding actions.
|
||
|
- Parameters: strCommand (String)
|
||
|
- Returns: Boolean indicating success/failure
|
||
|
|
||
|
### DisplayOutput()
|
||
|
Shows command execution results in the output area.
|
||
|
- Parameters: strOutput (String)
|
||
|
- Updates the output text area with formatted results
|
||
|
|
||
|
### HandleError()
|
||
|
Manages error conditions and displays appropriate messages.
|
||
|
- Parameters: errNumber (Long), errDescription (String)
|
||
|
- Updates status bar with error information
|
||
|
|
||
|
### LoadHistory()
|
||
|
Retrieves and displays command history.
|
||
|
- Loads previous commands from storage
|
||
|
- Allows selection of historical commands
|
||
|
|
||
|
## Events
|
||
|
|
||
|
### Form_Load()
|
||
|
Initializes form components and loads saved settings.
|
||
|
|
||
|
### Form_Unload()
|
||
|
Saves current settings and cleans up resources.
|
||
|
|
||
|
### Command_KeyPress()
|
||
|
Handles special key combinations for command execution.
|
||
|
|
||
|
## Dependencies
|
||
|
- Requires CommandParser.cls
|
||
|
- Uses ErrorHandler.cls
|
||
|
- References Settings.cls for configuration
|
||
|
|
||
|
## Usage
|
||
|
1. Enter command in input box
|
||
|
2. Click Execute or press Enter
|
||
|
3. View results in output area
|
||
|
4. Check status bar for execution status
|
||
|
|
||
|
## Error Handling
|
||
|
- Validates command syntax
|
||
|
- Catches runtime errors
|
||
|
- Displays user-friendly error messages
|
||
|
- Logs errors for troubleshooting
|
||
|
|
||
|
## Notes
|
||
|
- Supports command history
|
||
|
- Maintains persistent settings
|
||
|
- Compatible with custom command plugins
|