Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 3/WHILE..DO/fr

Sent here from WHILE..DO/fr.

English · Français · Български · 中文(中国) · 日本語

Tutoriel de Pascal Objet : Structures de contrôle / Boucles / Tant que

La boucle pré-test a le format suivant :

pascal
while BooleanExpression do
  Instruction;

La boucle continue à s'exécuter jusqu'à ce que l'expression devienne FALSE. Dans le corps de la boucle, vous devez en quelque sorte affecter une des variables qui sont utilisées dedans. Sinon, vous aurez une boucle infinie :

pascal
a := 5;
while a < 6 do
  writeln (a);

Il faut remédier à cette situation en changeant la valeur de la variable :

pascal
a := 5;
while a < 6 do
begin
  writeln (a);
  a := a + 1
end;

La boucle WHILE ... DO est appelée boucle pré-test parce que le test est réalisé avant que le corps de la boucle ne soit exécuté. Donc, si la condition n'est pas vérifiée (=FALSE) au départ, le corps de la boucle ne sera pas jamais exécuté. La condition est appelée invariant de boucle.


From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 3/WHILE..DO/fr", as it stood on 2022-08-20 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Edited on wiki.freepascal.org by 6 people, 2014–2022

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
E-ricCreated page
E-ric
FTurtle
FrigoryRefonte
FrigoryNom de page
FrigoryChemin
InspiratorFautes d'orthographes (minor)
TrevFixed syntax highlighting (minor)
TrevText replacement - "Object Pascal Tutorial" to "Basic Pascal Tutorial" (minor)
Kai BurghardtKai Burghardt moved page WHILE..DO/fr to Basic Pascal Tutorial/Chapter 3/WHILE..DO/fr: tidy up main name space: create subpage hierarchy for basic Pascal tutorial [cf. [[Special: PermaLink/149778#Clut... (minor)
Kai Burghardtbypass redirects [cf. discussion]
Kai Burghardtbypass language bar/categorization template redirect [cf. discussion] (minor)

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.