And Thomas 'Pointed Ears' Lahn replied:
You almost got it.
1. Who is `I' in a cited *public* discussion?
2. The basics of accepted attribution are described in the newsgroup's
FAQ notes. I strongly suggest you read those (more) thoroughly.
Posting borken quotes subsequently corrected in the view of Google Groups
users are a major malfunction of the Google Groups Web interface. I
strongly suggest that either you perform manual reformatting so that quoted
lines do not exceed 72 characters per line, or stop using Google Groups for
posting and start using a newsreader application instead. GG ist still good
for research, though.
The problems and potential bugs come when you have something that you
think is a string, but it happens to contain only digits and so is a
number: e.g. phone numbers, credit card numbers and so on. (Have you
ever seem a program or web site strip leading zeros from a phone
number?
No, and such applications would be borken. Leading zeroes in phone numbers
indicate that the participant is located outside the current city (0) or
country code (00) area and thus must not be stripped automatically; this
requires the phone number to be stored (in the database) and processed (as
variable value) as a character string .
Or suffer an integer overflow when you enter 20 digits?).
What's your point? A 20-digit number where leading zeroes are allowed to be
stripped is pretty well covered by a 64 bit floating-point number
representation (but it is likely to be rounded) as used in JavaScript 1.0
and ECMAScript implementations. Other languages also introduce appropriate
long integer types. Unless the application has been improperly designed,
there is no reason for an integer overflow here.
Or, vice-versa, you think you have a number but actually have a string;
this could easily happen if you have parsed a number out of a string
with a regexp, for example, and it's difficult to debug because
'alert(x)' will give no clue.
alert([x, typeof x, x.length]);
certainly will.
The incident that I mentioned before was a long time ago and I forget
the details, but it was to do with parsing CSS length units, i.e.
splitting something like "10px" into a number (10) and a unit (px);
instead of adding 1 to the length (11px) I ended up appending 1
(101px).
See the *real* problem?
Try this:
[...]
c-=-1;
[...]
You'll see that += and -=- have the same behaviour when their operands
are numbers. When one or other is actually a string, += does a string
append while -=- converts them to numbers first.
Now I see it, you use the `-=' operator (not `-=-') and a previously omitted
negative number as operand. That can become useful, although it alone is
less efficient than simple `+='.
PointedEars