コード例 #1
0
        public IValue StrGetLine(IValue str, IValue number)
        {
            int    line_number = number.AsInt();
            var    str_arg     = str.AsString();
            string result      = "";

            if (line_number >= 1)
            {
                string[] subStrVals = str_arg.Split('\n', line_number + 1);
                result = subStrVals[line_number - 1];
            }

            return(ValueFactory.Create(result));
        }
コード例 #2
0
        public bool Equals(IValue other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (other.BaseType == ValueTypeEnum.TYPE)
            {
                return(_value.Index == other.AsInt());
            }

            return(false);
        }
コード例 #3
0
 public int CompareTo(IValue other)
 {
     return(_value.Index.CompareTo(other.AsInt()));
 }
コード例 #4
0
 public void Set(IValue index, IValue value)
 {
     _values[index.AsInt()] = value;
 }
コード例 #5
0
 public IValue Get(IValue index)
 {
     return(_values[index.AsInt()]);
 }
コード例 #6
0
 public void Delete(IValue value)
 {
     _values.RemoveAt(value.AsInt());
 }
コード例 #7
0
 public void Insert(IValue index, IValue value)
 {
     _values.Insert(index.AsInt(), value);
 }