Skip to content

Class Program

Kristian Virtanen edited this page Oct 28, 2024 · 4 revisions

Description:

The Program class provides methods and properties related to the execution of the program, including handling command-line arguments, introducing delays, and terminating the program. It also includes error handling via the LastError property, which stores the most recent error message if an operation fails.

Properties

Program.LastError

  • 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 argument index."
  • Differences from orig. SB: New feature for SBOE.

Program.ArgumentCount

  • Description: Returns the number of command-line arguments passed to the program (excluding the program name).
  • Differences from orig. SB: none.

Program.Directory

  • Description: Returns the directory where the program is being executed.
  • Differences from orig. SB: none.

Methods

Program.Delay(milliSeconds)

  • Description: Delays the program execution for the specified number of milliseconds.
  • Parameters:
    • milliSeconds: The number of milliseconds to delay the program.
  • Differences from orig. SB: none.

Program.Sleep(seconds)

  • Description: Pauses the program execution for the specified number of seconds. The sleep can be interrupted by a key press.
  • Parameters:
    • seconds: The number of seconds to sleep.
  • Differences from orig. SB: New feature for SBOE.

Program.End()

  • Description: Ends the program execution immediately.
  • Differences from orig. SB: none.

Program.GetArgument(index)

  • Description: Retrieves the command-line argument at the specified index (0-based).
  • Parameters:
    • index: The index of the command-line argument to retrieve.
  • Returns: The command-line argument as a string, or null if the index is invalid.
  • Differences from orig. SB: none.

Top

Clone this wiki locally