Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dimensioning javascript arrays
Message
De
26/08/2002 13:08:09
 
 
À
19/08/2002 13:06:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00691111
Message ID:
00693727
Vues:
17
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!

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform