Index out of range

sharon95sharon95 Member Posts: 183
I created an array with dimension 10000, I insert the values with
      [...]
      Array[j] := Progr;
      j+=1;
      UNTIL Book.NEXT = 0;
and then I select the values I want.
  FOR k:=1 TO j-1 DO
    IF Array[j+1] - Array[j] <> 1 THEN
      counter += 1;
I tried to change the index but I always get the error "index out of range"... heeelpppp meee!! Thanks!

Best Answer

Answers

  • sharon95sharon95 Member Posts: 183
    edited 2017-01-13
    ...... :#:D:D
    but I always get the error....
  • sharon95sharon95 Member Posts: 183
    vremeni4 wrote: »
    Hi,

    The code is a bit reduced, but if I look at your code it says
    IF Array[j+1] - Array[j] <> 1 THEN
    
    can you change this into
    IF Array[k+1] - Array[k] <> 1 THEN
    

    I hope this helps.

    ok, solved.... I've initialized the counter in a wrong way! Thank you!
Sign In or Register to comment.