-
Notifications
You must be signed in to change notification settings - Fork 0
Class Program
Kristian Virtanen edited this page Oct 14, 2024
·
4 revisions
Provides methods and properties related to the execution of the program, including command-line argument handling delays, and termination.
Program.ArgumentCount- Gets the number of command-line arguments passed to the program (excluding the program name).
Program.Directory- Gets the directory where the program is being executed.
Program.Delay(milliSeconds)- Delays the program execution for the specified number of milliseconds.
- Unlike
Program.Sleep(seconds), Delay can't be interrupted
Program.End()- Ends the program execution immediately.
Program.GetArgument(index)- Retrieves the command-line argument at the specified index.
Program.Sleep(seconds)- Delays the program execution for the specified number of milliseconds.
- Unlike
Program.Delay(milliSeconds), Sleep can be interrupted
Program.Delay(3000) ' Waits 3 seconds even if key is pressed.
Program.Sleep(3) ' Waits 3 seconds, but can be interrupted by keypress.
TextWindow.WriteLine(Program.ArgumentCount) ' Writes the amount of parameters program received.
TextWindow.WriteLine(Program.Directory) ' Writes the program directory path.
TextWindow.WriteLine(Program.GetArgument(1)) ' Writes first argument, if received.
Program.End() ' Closes the programnamespace SmallBasicOpenEditionDll
{
class Program2
{
static void Main()
{
Program.Delay(3000); // Waits 3 seconds even if key is pressed.
Program.Sleep(3); // Waits 3 seconds, but can be interrupted by keypress.
TextWindow.WriteLine(Program.ArgumentCount); // Writes the amount of parameters program received.
TextWindow.WriteLine(Program.Directory); // Writes the program directory path.
TextWindow.WriteLine(Program.GetArgument(1)); // Writes first argument, if received.
Program.End(); // Closes the program
}
}
}