-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
5,580 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,41 @@ | ||
using Microsoft.SmallBasic.Library; | ||
using System; | ||
|
||
/// <summary> | ||
/// The Arguments object provides operations to access the command-line arguments that were passed at the start of this program. | ||
/// This class has been taken from Small Basic version 0.2. | ||
/// </summary> | ||
[SmallBasicType] | ||
public static class ZSArguments | ||
namespace ZS | ||
{ | ||
private static string[] args = Environment.GetCommandLineArgs(); | ||
|
||
/// <summary> | ||
/// Gets the number of command-line arguments passed to this program. | ||
/// </summary> | ||
public static Primitive Count | ||
{ | ||
get { return (args.Length != 0) ? (args.Length - 1) : 0; } | ||
} | ||
/// <summary> | ||
/// The Arguments object provides operations to access the command-line arguments that were passed at the start of this program. | ||
/// This class has been taken from Small Basic version 0.2. | ||
/// </summary> | ||
[SmallBasicType] | ||
public static class ZSArguments | ||
{ | ||
private static string[] args = Environment.GetCommandLineArgs(); | ||
|
||
/// <summary> | ||
/// Returns the specified argument. | ||
/// </summary> | ||
/// <param name="index"> | ||
/// Index of the argument. | ||
/// </param> | ||
/// <returns> | ||
/// The command-line argument at the specified index. | ||
/// </returns> | ||
public static Primitive GetArgument(Primitive index) | ||
{ | ||
int num = index; | ||
if (num >= 1 && num < args.Length) | ||
{ | ||
return new Primitive(args[num]); | ||
} | ||
return new Primitive(""); | ||
} | ||
} | ||
/// <summary> | ||
/// Gets the number of command-line arguments passed to this program. | ||
/// </summary> | ||
public static Primitive Count { | ||
get { return (args.Length != 0) ? (args.Length - 1) : 0; } | ||
} | ||
|
||
/// <summary> | ||
/// Returns the specified argument. | ||
/// </summary> | ||
/// <param name="index"> | ||
/// Index of the argument. | ||
/// </param> | ||
/// <returns> | ||
/// The command-line argument at the specified index. | ||
/// </returns> | ||
public static Primitive GetArgument(Primitive index) | ||
{ | ||
int num = index; | ||
if (num >= 1 && num < args.Length) { | ||
return new Primitive(args[num]); | ||
} | ||
return new Primitive(""); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.