Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Loopin a variable length array
Message
De
20/02/1999 17:06:40
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Loopin a variable length array
Divers
Thread ID:
00189697
Message ID:
00189697
Vues:
50
Howdy,

I have an array used to store references to controls on a multi-page form whose values may need to be recalculated.

The form contains controls whose values may be dependent on the value of another control. The controls are linked though a form mediator. A control whose value is dependent on the value of another control sends a message during its Init() requesting notification when the first control's value changes.

If the first control's value then changes, a reference to the requesting control is added to an array of controls to be recalculated.

When it comes time to recalculate all of the dependent control values, the mediator loops through the recalculation array, calculating each control in turn.

Here's the rub. As the mediator is processing the controls in the array, more than likely at least one of the controls processed has a dependency so that as that control's value is calculated, the dependent control adds itself to the end of the array so that it will then be recalculated in its turn.

This means that the number of elements in the array is changing as the array is being processed.

I have tried all combinations of FOR/ENFOR and FOR EACH/ENDFOR I can thing of, but have gone back to the tried and true DO/ENDDO loop to ensure that the entire array is processed.

I am looking for a faster solution.

Any thoughts would be appreciated.

regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform