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

Un livre de Wikilivres.
Contenu supprimé Contenu ajouté
Tavernierbot (discussion | contributions)
DannyS712 (discussion | contributions)
m <source> -> <syntaxhighlight> (phab:T237267)
Ligne 17 : Ligne 17 :
Exemples&nbsp;:
Exemples&nbsp;:


<source lang="fortran">
<syntaxhighlight lang="fortran">
for i = 1 to n with x(i) > 0 ...
for i = 1 to n with x(i) > 0 ...


Ligne 24 : Ligne 24 :
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 ...


</syntaxhighlight>
</source>


[[Catégorie:Simscript III (livre)]]
[[Catégorie:Simscript III (livre)]]

Version du 16 avril 2020 à 10:11

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 ...