-
Notifications
You must be signed in to change notification settings - Fork 0
Class TextWindow
Kristian Virtanen edited this page Oct 28, 2024
·
4 revisions
The TextWindow
class provides methods and properties for interacting with the console (text) window, including window manipulation, cursor control, and reading/writing text. It also includes error handling via the LastError
property, which stores the most recent error message if an operation fails.
-
Description: Stores the last error message, if any operation fails, including a timestamp in
yyyy-MM-dd HH:mm:ss
format. -
Example:
"2024-10-16 14:30:00: Invalid number received."
- Changes from orig. SB: New feature for SBOE.
- Description: Gets or sets the foreground color of the text in the console window.
- Changes from orig. SB: none.
- Description: Gets or sets the background color of the console window.
- Changes from orig. SB: none.
- Description: Gets or sets the cursor's column position in the console window.
- Changes from orig. SB: none.
- Description: Gets or sets the cursor's row position in the console window.
- Changes from orig. SB: none.
- Description: Gets or sets the title of the console window.
- Changes from orig. SB: none.
- Description: Shows and restores the text window if it is minimized or hidden.
-
Returns:
true
if successful,false
if an error occurs. -
Changes from orig. SB: SBOE returns
true
orfalse
by succes.
- Description: Hides the text window.
-
Returns:
true
if successful,false
if an error occurs. -
Changes from orig. SB: SBOE returns
true
orfalse
by succes.
- Description: Clears all the content of the console text window.
- Changes from orig. SB: none.
- Description: Pauses execution and waits for user input, displaying the message "Press any key to continue...".
- Changes from orig. SB: none.
- Description: Pauses execution and waits for user input, displaying the message "Press any key to continue..." if the console window is visible.
- Changes from orig. SB: none.
- Description: Pauses execution without displaying a message, waiting for a key press.
- Changes from orig. SB: none.
- Description: Reads a line of text from the console window.
- Returns: The string input from the console.
- Changes from orig. SB: none.
- Description: Reads a single key press from the console window.
- Returns: The character corresponding to the key pressed.
- Changes from orig. SB: none.
- Description: Reads a number from the console window.
-
Returns: The number input from the console, or
null
if the input is not a valid number. -
Changes from orig. SB: SBOE returns
null
incase of error.
- Description: Writes data to the console window, followed by a new line.
-
Parameters:
-
data
: The data to write.
-
- Changes from orig. SB: none.
- Description: Writes data to the console window without appending a new line.
-
Parameters:
-
data
: The data to write.
-
- Changes from orig. SB: none.
- Description: Simulates verifying access to the text window.
-
Returns:
true
if access to the console window is verified; otherwise,false
. - Changes from orig. SB: none.