07-31-2013 02:38 PM
I read data from Excel into a 2D array in TestStand, after some data manipulation I have data i need to write to Excel via a 2D array, i need the sizes to be the same but they vary based on which input i read. How can i resize my output array? I've tried SetArrayBounds( Locals.valuesToExcel,"0",Str( Locals.i - 1)) with Locals.i = size of input +1
07-31-2013 02:39 PM
i am using TS 2012 with office 2007
08-01-2013 09:05 AM - edited 08-01-2013 09:06 AM
For a 2d array you need two dimensions, but in your example you only show one. Did you really mean 2D or just that you want to resize a one dimensional array?
For a one dimensional array you can either do this:
SetArrayBounds( Locals.valuesToExcel, "[0]", Str( Locals.i - 1, "[%d]"))
Or this:
SetNumElements(Locals.valuesToExcel, Locals.i)
For a 2d array it would look something more like this:
SetArrayBounds( Locals.valuesToExcel, "[0][0]", Str( Locals.i - 1, "[%d]") + Str( Locals.secondDimensionUpperBound, "[%d]"))
Hope this helps,
-Doug
08-01-2013 11:03 AM
I did mean 2D but wasn't sure how to make that expression, didn't know about the "[0][0]" so i'll give it a try, thanks