i have learnt how to solve the array out of bound error!!!!

i solved a problem on my own, reflecting on this post. Ya!.

i download any java editor, i google and http://www.jedit.org/index.php?page=download came up.

after installing

i browsed to the error file
LookangVernierCaliper04FKH.java for example
look for the error line it was, say line 803

with jedit is easy to locate that line,

for example the old code is //xp=xm2t[vs]; // this is the way to determine position of lower scale pointer

that means vs jumps to a illegal value from what was defined in the variable page

for my example xm2t is defined as an array n2t where n2t is defined as 11.

insert and modify logically . my example is

// adding this code to solve array out of bound error 803
// http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1183.0 solution discussed
if(vs >  -1 && vs< n2t)vsidarray=vs;
else vsidarray=0;// or other valid values.

// this line is causing array out of bound error 803
//xp=xm2t[vs]; // comment that line that is causing the array out of bound error
xp=xm2t[vsidarray]; // modify logically to this

this way, no more array error out of bound 12 because n2t is 0 to 10.