Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing arrays as parameters
Message
De
28/07/2000 15:34:53
 
 
À
28/07/2000 15:20:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00398308
Message ID:
00398313
Vues:
20
Add the EXTERNAL ARRAY command after the LPARAMETERS to let the compiler know that this is an array coming in.
e.g.
LPARAMETERS lpPos, lpVal, lpArray
<b>EXTERNAL ARRAY lpArray</b>
LOCAL iPos, iLen, iStart
If the array originates in the method or function, there will have been a DIMENSION, DECLARE or the array was created in the scope command - e.g., LOCAL laArray(1,1) - so those are recognized as arrays.
The program would work because it know it's an array since it's in memory.
However, since the compiler doesn't follow naming conventions, and VFP doesn't have strong variable typing, and array elements can be accessed the same way function can be called; something extra is needed to indicate to the compiler that the item is an array.
e.g. Which of these is attempting to get the first element from an array and which is passing 2 parameters to a program?
OneThing(1,1)
AnotherThing(1,1)
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform