Пример #1
0
            public override void Invoke(SpoolSpace Memory)
            {
                Cell x = this._Parameters[0].Evaluate(Memory);

                if (x.Affinity == CellAffinity.ARRAY)
                {
                    x.ARRAY.Sort();
                }
                else if (x.Affinity == CellAffinity.TREF)
                {
                    Table t = this._Host.OpenTable(x.valueTREF);
                    Key   k = new Key();
                    if (this._Parameters.Count >= 2)
                    {
                        Cell y = this._Parameters[1].Evaluate(Memory);
                        if (y.IsNumeric)
                        {
                            k.Add(y.valueINT);
                        }
                        else if (y.IsArray)
                        {
                            foreach (Cell z in y.valueARRAY)
                            {
                                k.Add(z.valueINT);
                            }
                        }
                        else
                        {
                            k = Key.Build(t.Columns.Count);
                        }
                    }
                    Spectre.Tables.TableUtil.Sort(t, k);
                }
            }