month one less than expected (Program Bug and Problems)

by Andrew360 @, Tuesday, March 11, 2014, 22:07 (1107 days ago) @ gyorgy.miklos

On most programming languages, indices begin on zero. This means that instead of counting from 1 to 100, it would count from 0 to 99. One example is plotting on the screen - (0,0) is top left and (299,299) is bottom right.

Another example is arrays. If an array had 5 elements, the first would be written as array[0] and the last would be array[4]. So if it had twelve elements you could do this:

months$={"Jan","Feb","March", "April","May","June", "July","Aug","Sept", "Oct","Nov","Dec"}
print months$[month]

Complete thread:

 RSS Feed of thread

powered by my little forum