コード例 #1
0
ファイル: ArrayResizer.cs プロジェクト: rkapl123/Samples
        // Makes an array, but automatically resizes the result
        public static object dnaMakeArrayAndResize(int rows, int columns, string unused, string unusedtoo)
        {
            object[,] result = dnaMakeArray(rows, columns);
            return(ArrayResizer.dnaResize(result));

            // Can also call Resize via Excel - so if the Resize add-in is not part of this code, it should still work
            // (though calling direct is better for large arrays - it prevents extra marshaling).
            // return XlCall.Excel(XlCall.xlUDF, "Resize", result);
        }
コード例 #2
0
ファイル: ArrayResizer.cs プロジェクト: rkapl123/Samples
        public static object dnaMakeMixedArrayAndResize(int rows, int columns)
        {
            object[,] result = new object[rows, columns];
            for (int j = 0; j < columns; j++)
            {
                result[0, j] = "Col " + j;
            }
            for (int i = 1; i < rows; i++)
            {
                for (int j = 0; j < columns; j++)
                {
                    result[i, j] = i + (j * 0.1);
                }
            }

            return(ArrayResizer.dnaResize(result));
        }