NikhilS / vb2js

Automatically exported from code.google.com/p/vb2js
2 stars 3 forks source link

Incorrect number of array elements in converted JS. #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
VBA:
Dim Array(5)

Actual JS:
var Array = new Array(5);

Expected JS:
var Array = new Array(6);

In VBA, Array(5) contains index 0 - 5, which creates 6 elements. In JS, 
Array(5) means index of 0 - 4, 
creates total of 5 elements.  If user change VBA to Dim Array (1 to 5) or Dim 
Array(0 to 5), it is not 
making any difference in JS. This is incorrect.  JS should be var Array = new 
Array(6)

Original issue reported on code.google.com by nikhilsi...@google.com on 16 May 2010 at 5:57