Denis McMahon
10/18/2014 10:18:00 PM
On Fri, 17 Oct 2014 09:29:54 -0700, Ed Jay wrote:
>>So I can't really see what the problem is - can you offer code that
>>demonstrates it?
>
> Thanks for the response. I can't see it either. :-)
>
> I create a div for hit zones over a canvas if some conditions are met.
> Code - .....
By inspection your code will not run, it seems to be missing a statement
terminator, have an imbalance of "{" vs "}", and at least one logic test
is not correctly enclosed in "()". Additionally some guesswork is
required to determine where comments terminate and new lines begin.
Hence it is impossible for your code to demonstrate the problem case,
moreover I suspect to do so it would need some minimal html wrapper to go
with it in order to provide a dom context in which it operates.
We can not magically deduce the part(s) of the problem that you fail to
supply us with when explaining what isn't working.
In future, when posting a problem, please post the minimum sufficient
code (including the html document body if needed) that enables the
problem being described to be reproduced in a browser or other javascript
interpreter. This is a generic issue that applies to any request for help
with programming, regardless of language, you should endeavour to post
minimum example code that the reader can run to reproduce the actual
problem you are trying to solve.
The problem you appear to be asking about (see the subject line) is that
you are experiencing a case where assigning values to array s, and then
assigning array t to be equal to array s, t[n] is undefined when s[n] is
defined.
Nothing in the code you posted demonstrates this, at least in part
because the code isn't executable due to the above mentioned errors.
1) Develop code (or possibly in your case an html document with embedded
script element) that demonstrates the exact problem.
2) Cut the document down to the minimum code that shows the problem.
3) Use /* ..... */ style comments so it is clear where comments end,
especially when posting code to usenet where line wrapping may not be
preserved.[1]
4) Post the whole document here if fairly short (eg less than 30 lines or
so) or if larger post a link to it on a web server.
5) Remember step 2, it really is important. The more code that is
irrelevant to the problem that we need to trawl through and try and
understand the more likely we are to lose interest. We are not going to
do step 2 for you, you need to do that as part of the we fix your code
deal.
[1] I've been using usenet and similar for 25+ years, and I still haven't
worked out a consistent and guaranteed way to preserve line breaks in
code postings[2] that allows for the vagaries of all the different
clients and the way they process received text and quote it. Don't even
bother trying!
[2] Apart from posting the source somewhere and posting a link to it in
the message, which upsets some purists, but which is sometimes the only
way to do it.
--
Denis McMahon, denismfmcmahon@gmail.com