Substr bug in loop behaviour

Interesting problem and a possible bug. I have the code and result in attached screen shot.

  1. loop from 1 to 20
  2. debug.log substr(var,counter,1)
  3. counter=counter+1


This should show each character in the string from left to right but it stops. So 'abcdef' would show 'a' and stop.

If I were to debug.log substr(var,counter,20), it does show as exptected. So 'abcd..', 'bcd...', 'cd...' etc.


Am I missing something here or do we have a bug?


Comments

Sign In or Register to comment.