« Simscript III/Dictionnaire des instructions/WITH » : différence entre les versions

Un livre de Wikilivres.
Contenu supprimé Contenu ajouté
Djihane (discussion | contributions)
Nouvelle page : <font color="#0000FF">with</font> est utilisée pour contrôler l<nowiki>’</nowiki>exécution d<nowiki>’</nowiki>une boucle (commandée par un énoncé <font color="#0000FF">for<...
 
Aucun résumé des modifications
Ligne 19 : Ligne 19 :
<source lang="fortran">
<source lang="fortran">
for i = 1 to n with x(i) > 0 ...
for i = 1 to n with x(i) > 0 ...

for each Train in Ligne(1) with Vitesse(Train) <= 25.0 do ...
for each Train in Ligne(1) with Vitesse(Train) <= 25.0 do ...

while i < max with y(i) > 0 and y(i) + z(i) < 2 do ...
while i < max with y(i) > 0 and y(i) + z(i) < 2 do ...

</source>
</source>

Version du 24 novembre 2008 à 21:56

with est utilisée pour contrôler l’exécution d’une boucle (commandée par un énoncé for, while, until ou list attributs of each). C’est un proche parent d’unless.

Syntaxe :



Exemples :

for i = 1 to n with x(i) > 0 ...

for each Train in Ligne(1) with Vitesse(Train) <= 25.0 do ...

while i < max with y(i) > 0 and y(i) + z(i) < 2 do ...