Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Monad Research
Message
De
20/01/2009 08:31:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
19/01/2009 13:50:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01375100
Message ID:
01375406
Vues:
9
>>So, a particle will exchange its velocity (dx, dy, dz) with every other particle. That means that when you finish one cycle of exchanges, a particle will retain the velocity of the last particle it happened to interact with. The order of the interaction can make quite a difference, then. I would say, the FOR EACH doesn't give you a very fine control over the order in which the particles interact. Perhaps you should use an array to have a better control over this order of exchanges.
>
>
>Hmmm.
>
>Shouldn't
>
>FOR EACH xxx IN myarray
>
>be exactly equal to
>
>FOR nnn = 1 to alen(myarray)
> xxxx = myarray[nnn]
>
>?

It should do the same, except for the order - and in this case, the order of evaluation seems to be important. I believe that with a for each, you have no way of controlling the order.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform