Example #1
0
        protected void FormatArray(Thread target, TargetArrayObject aobj)
        {
            TargetArrayBounds bounds = aobj.GetArrayBounds(target);

            if (bounds.IsUnbound)
            {
                Append("[ ]");
            }
            else
            {
                FormatArray(target, aobj, bounds, 0, new int [0]);
            }
        }
Example #2
0
        public int[] GetDimensions()
        {
            TargetArrayBounds bounds = array.GetArrayBounds(ctx.Thread);

            if (bounds.IsMultiDimensional)
            {
                int[] dims = new int [bounds.LowerBounds.Length];
                for (int n = 0; n < bounds.Rank; n++)
                {
                    dims [n] = bounds.UpperBounds [n] - bounds.LowerBounds [n] + 1;
                }
                return(dims);
            }
            else if (!bounds.IsUnbound)
            {
                return new int[] { bounds.Length }
            }
            ;
            else
            {
                return(new int [0]);
            }
        }