Re: can .range return a 1D array?



Dave Peterson wrote:
And if arr is a single row 2-D array, then


As will:

with application
arr = .transpose(.Transpose(arr))
end with

just another way...


Which reminds me . . .

Both arr = Application.Transpose(Application.Transpose(arr)) and
arr = Application.Index(arr,1,0)

will return a 1-based array, regardless of the base of the array that was input.

If the add-in functions I referred to in my previous post are available to the workbook

arr = OneD(arr) will return a 1-based or 0-based array, depending on the base of the array that was input.

Alan Beban
.



Relevant Pages

  • Re: Evaluating unary *
    ... 'arr' exists, ... value can be used with the same syntax as would be used to access a 2D array of the kind you're referring to, but that 2D array is just a different way of looking as the same object that was already created by the definition of 'arr'. ... to me, it makes sense to return a pointer to the first value of an array, but to return the address of the pointer to the first value of an array, is not directly possible as such. ... lea eax, ...
    (comp.std.c)
  • Re: Evaluating unary *
    ... value can be used with the same syntax as would be used to access a 2D array of the kind you're referring to, but that 2D array is just a different way of looking as the same object that was already created by the definition of 'arr'. ... the expression &arr requires no special handling beyond insertion of the appropriate address into a suitable register. ... to me, it makes sense to return a pointer to the first value of an array, but to return the address of the pointer to the first value of an array, is not directly possible as such. ... It does create a pointer value which points at arr itself, and treats the entirety of arr as the first element in an array containing exactly one element of type int. ...
    (comp.std.c)
  • Re: multi dimensional arrays as one dimension array
    ... Are you of the opinion that one or both of memcpy(p, arr, sizeof arr) ... way of converting a two-dimensional array into a one-dimensional ... &arr) is supposed to be pointer constrained legally to range over ... arrays of character type and other objects treated as arrays ...
    (comp.lang.c)
  • Re: can .range return a 1D array?
    ... LBound of arrays that are declared like this: ... Dim ptr As Long ... ' Variant parameter that has received the array ... ' Sets Ary's LBound to NewBound, ...
    (microsoft.public.excel.programming)
  • Re: Fastest reading of large text files
    ... As I understand it, arr is an array of type Variant, which the function ... OpenTextFileToArray is populating with the contents of the named text file. ... But is it not an array in the PROGRAM? ... Dim hFile As Long ...
    (microsoft.public.excel.programming)

Loading