The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
The Church disagees. 1BC was followed by 1AD. There was no 0BC/8AD inbetween.
This has been recognized by historicans for decennies, maybe centuries. Today, it is also recognized by all (serious) developers of computer software handling historic data, hereunder genealogical information.
Enjoy it or hate it - your choice! In our office building, our elevator goes directly from floor 1 to floor -1. For our mental comfort, we declared that there is in fact a floor 0 inbetween them, but it is virtual. And since it is virtual, the elevator operating in real space cannot make a stop in virtual space - that is why it skips directly from 1 to -1.
We have learned to live with it. Similarly, you will have to learn with years skipping directly from -1 to 1 without a stop at 0.
The church can't spell and I disagree with it anyway. I live in this world and I can make my own assumptions for my world view. I don't need anyone else to agree with me except when necessary. To be polite, I will agree with other people when necessary.
- I would love to change the world, but they won’t give me the source code.
You also have ground floors. The floors in uncivilized countries are not the ground, it is raised from the ground, usually by a either a layer of concrete or wooden beams, and then a layer of planks above that, usually topped by tiles, carpeting or e.g. a vinyl cover. We prefer that, compared to walking directly on the ground ... even if it less civilized.
VB arrays have an 0th element by default. It's just ignored/skipped by many programmers. The confusion of caused that the DIM statement doesn't actually give the dimension (as the equivalent in C/C++/C# does), but instead the upper limit.
I am not making any assumption. I am starting from the beginning of the array.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
Yet another poorly-worded spec. You definitely need to know which element to start with. It should at least be something along the lines of, "starting with element n, select every mth element".
To cover the variants I can think of at the moment, I would write a method which takes three parameters: the index of the first element to select, how many elements to select from that position, and the number of elements to skip to get to the next element to select.
The ninth element is #55, the eigth is #54... the 1st is #48, the 0th is #47. Fair enough, from a programmer point of view. Your grandmother might disaggree. But as we all know: Today, computer guys rule the world.
In sports games, we still rank the competitors as "1st place", "2nd place" and "3rd place". As soon as computer guys succeed in taking over sports, it most surelu will be changed to "0th place", "1st place" and "2nd place"...
Let's say you're instructed to "get on the highway headed east and drive to the second exit". You don't count the interchange you enter at. Nor do you consider where "exit 2" might be -- you may have entered at exit 2, or it may be to your west.
So "every tenth" has nothing to with how the elements may be indexed, only with which order they're encountered in.
For that matter, does it matter if an array cell is empty? Would those count?
I don't think this is a question about English but about "Computerese".
A well known joke is that "Computer amateurs think 256 is a round number. Real computer guys consider 255 a round number - they count from zero."
Before computer guys took over the world, arrays could have any base. In Pascal, an array could run from index 1814 to 2050. Ordinary people could relate to it, e.g. as years. That reduced the importance of the Computer Guys, so they detested it. Even the Fortran style, where the first element of array a was a, was too obvious to Common Man, reducing the power of the Computer Guy. Luckily, base zero index won the war. (There is only a small problem left: What if there is no "zero" element, like in the calender? What happened in year 1 belongs in eventsOfYear, but what about eventsOfYear? That year never existed! Year -1 was immediately followed by year 1! ... Fortunately, the Unix epoch doesn't apply to historic dates!)
Yet, there is a question of where "every 10th" is counted from: Is the "first" (or zeroth, if you like) every tenth element the one with the lowest index, the one with the tenth lowest index, or the one ten above the lowest index? If we had had a quantum computer, it could have provided all three results, with varying degrees of probability/validity.
Even early FORTRAN compilers used the trick of using address of A(n) as being (address of fictitious A(0)) + (n * width of data type of A); or as the literature of the day put it (address of A(1)) + (n - 1) * (width of data type A)
[historical note: versions of FORTRAN prior to 1977 only had uppercase variable name and all versions used '(' and ')', not '[' and ']'; but that doesn't affect the validity of what I am saying]
The first computer I played around with at the instruction level had an instruction "MIX3" to decrement the accumulator by one and then multipy by 3. This was a 16-bit mini (PDP-11 class) with a 48 bit floating point format, 3 words (memory was not byte adressable). The instruction was tailor made for Fortran, to calculate the offset from the start of a 1-based float array of element "n" - just like you describe, but with a fixed element width of 3 words.