/// <summary> /// Gets a list with the given string id /// </summary> /// <param name="idstr">ID of list enclosed in double square brackets</param> /// <returns></returns> public static List <string> GetList(string idstr) { //Decodes the ID of the list int?v = ConConverter.ToInt(idstr.TrimStart('[').TrimEnd(']')); //If the ID was invalid if (v == null) { Command.ThrowNaNError(idstr, ErrorCode.NOT_A_NUMBER); } //If the ID is unclaimed if (!StandardLib.Variables.List.Registry.ContainsKey(v.Value)) { Command.ThrowGenericError("Attempted access of undefined list", ErrorCode.INVALID_CONTEXT); } return(StandardLib.Variables.List.Registry[v.Value]); }
/// <summary> /// Checks whether an argument can be represented as an integer /// </summary> /// <param name="index">Index of parameter to check</param> /// <returns></returns> public bool IsInteger(int index) { return(ConConverter.ToInt(this[index]).HasValue); }