Question:Please Login or Register to view this content.
1. Why does Arr get populated as a 1 d array beginng at zero, while Arr1 is treated as a 2d array beginning at 1?
Question:Please Login or Register to view this content.
1. Why does Arr get populated as a 1 d array beginng at zero, while Arr1 is treated as a 2d array beginning at 1?
Can't answer why setting a range begins index at 1, but I guess that's how it is defaulted as. Ranges are always 2D since they have rows and columns.
The array returned from Split function is always 1D.
The beginning index can be controlled by Option Base statement. If you want it to start from 1, do this:Split Function
Description
Returns a zero-based, one-dimensional array containing a specified number of substrings.
Please Login or Register to view this content.
Option Base Statement
Used at module level to declare the default lower bound for array subscripts.
Syntax
Option Base {0 | 1}
Last edited by millz; 09-20-2016 at 10:28 PM.
多么想要告诉你 我好喜欢你
Split/Filter function will never be affected by Option Base statement.
It always return 0 based 1 d string array.
However, Array function will be affected.
When you load Range to an array variable, it must be Variant type and always 1 based 2 d array.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks