Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dimensioning javascript arrays
Message
From
26/08/2002 13:08:09
 
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00691111
Message ID:
00693727
Views:
18
This message has been marked as the solution to the initial question of the thread.
>Hi ,
>
>How do I dimension an array in javascript?
>
>In vfp I do: dimension aTest[8,18]
>
>What is the JavaScript equiv?
>Neil
aTest = new Array(8);
for (row = 0; row < 8; row++)
 {
  aTest [row] = new Array(18);
 }
You canot redimension arrays in JS, however if you just use command like the following:
aTest[9] [20] = "some value on 10th row, 21st colum";
it will automatically "resize" the array.

Note that arrays in JS are zero-based (first element is with index 0) and actually are one-dimensional arrays (however you can have arrays from arrays as in the example above)

HTH
Zlatin Zlatev,
MCSD (VS6)

Make solutions, not programs!

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform