> If you've done a
> lot of programming with older programming languages, array positions
> start with 1, however, in Java, the position starts with 0.
How old are you talking? C and C++ start at 0! The year C++ was created
was in the early 70s wasn't it? C was obviously before C++. Perhaps
"older programming languages" and "in Java" are just bad choices of
words - either way you solved the OP's problem :).
Knute Johnson - 17 Nov 2006 04:26 GMT
>> If you've done a
>> lot of programming with older programming languages, array positions
[quoted text clipped - 4 lines]
> "older programming languages" and "in Java" are just bad choices of
> words - either way you solved the OP's problem :).
Basic and I think APL did too. Can't remember for sure, it's been too
long :-).

Signature
Knute Johnson
email s/nospam/knute/
Lionel - 17 Nov 2006 04:35 GMT
>>> If you've done a
>>> lot of programming with older programming languages, array positions
[quoted text clipped - 7 lines]
> Basic and I think APL did too. Can't remember for sure, it's been too
> long :-).
So is it a function of age or a function of the language :)? I don't
know that much about the history of languages so I wouldn't know . . .
Taria - 17 Nov 2006 09:06 GMT
> > Basic and I think APL did too. Can't remember for sure, it's been too
> > long :-).So is it a function of age or a function of the language :)? I don't
> know that much about the history of languages so I wouldn't know . . .
Eek! Don't start that math talk with me! I'm so full of math theory
and formulas, I'm going to blow up. Math midterm tomorrow, I really
should be studying and not here.
If I were to guess between 1(a function of age, 2) a function of a
language or 3) a function of neither, intuitively I will have to go
with, I hate to admit this but shh don't tell, it's a function of age.
bahaha
Taria
John W. Kennedy - 21 Nov 2006 01:42 GMT
>>> If you've done a
>>> lot of programming with older programming languages, array positions
[quoted text clipped - 7 lines]
> Basic and I think APL did too. Can't remember for sure, it's been too
> long :-).
BASIC depends on the dialect, and is sometimes an option. In APL, it's
an option.
Fortran and COBOL start at 1. PL/I starts at 1 if not otherwise specified.

Signature
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"
Patricia Shanahan - 17 Nov 2006 06:23 GMT
>> If you've done a
>> lot of programming with older programming languages, array positions
[quoted text clipped - 4 lines]
> "older programming languages" and "in Java" are just bad choices of
> words - either way you solved the OP's problem :).
My early programming experience was in Fortran. Although it allows the
programmer to specify a starting index when declaring an array, the
default is 1.
Patricia
John W. Kennedy - 21 Nov 2006 01:43 GMT
>>> If you've done a
>>> lot of programming with older programming languages, array positions
[quoted text clipped - 8 lines]
> programmer to specify a starting index when declaring an array, the
> default is 1.
Allowing the starting index is a modern improvement to the original
language.

Signature
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"
Taria - 17 Nov 2006 08:57 GMT
> > If you've done a
> > lot of programming with older programming languages, array positions
> > start with 1, however, in Java, the position starts with 0.How old are you talking? C and C++ start at 0! The year C++ was created
> was in the early 70s wasn't it? C was obviously before C++. Perhaps
> "older programming languages" and "in Java" are just bad choices of
> words - either way you solved the OP's problem :).
Lol, yah I don't think C was taught in some universities till about mid
80's :) Pascal was the hot new language then C took over. They used a
Unix environment instead of the PC environment. I remember my PC was a
C64 then. Lol, what memories.
Older languages, like Cobol (gasp, yes folks it still exists), HP
Basic, PL-1, and Fortran which is still commonly used by Mathlab/Octave
folk, today.
Anyway, bugs in your programs are the best way to learn and can be the
most fustrating.
Note: The Java Debugger is mighty handy, I must admit instead of
putting in manually debug statements. Kids are so spoilt these days.
(I'm kidding!) :)
Taria