{{{Déclaration}}}
{{Constante :}}
Const
MAX=23;
{{Variable :}}
var
toto : integer;
{{Type :}}
– integer : entier
– real : réel
– string[long] : chaine de caractère
– boolean : bouléen
{{Les Structures :}}
Structure = record
chp1:type;
chp2:type;
…
End;
{{Biblio :}}
Unit nombiblio
Interface
..
..
Implementation
..
..
End.
{{Procédures :}}
Procedure nomProc(listepar);
Var
…
…
Begin
…
…
End;
{{Fonction :}}
function nomFct(liste_param):typre_retour;
Var
…
…
Begin
…
…
End;
Liste paramètre :
[var]nom_param_1:type_para;[var]nom_param_2:type_para
{{{Structure de contrôle}}}
{{if}}
If (condition) then
Begin
…
…
end;
If (condition) then
Begin
…
…
end
else if condition then
begin
…
…
end
else
begin
…
…
end;
{{While :}}
While condition do
Begin
…
…
End;
Repeat
…
…
until condition;
{{Case}}
case choix of
val1 : begin
instruction;
end;
val2 : begin
Instruction;
end;
else : begin
Instruction;
end;
end;
{{For}}
for compt:= valeur_initial to valeur_fin do
begin
…
end;
to : pour incrementé
downto : pour décrémenté
{{{Les Opérateur :}}}
– arithmétique : + – / *
– logique : or, and, not
– comparaison : < <= > >= = <>
– affectation : ‘:=’
– concaténation : , et +
{{{Diver :}}}
– affichage : writeln();l
– saisie : readln();
{{{Les fichiers :}}}
Tfromfile = file of type; /* type de fichier */
– ouvrir un fichier en lecture :
reset(nomfichier);
– ouvrir un fichier en écriture :
rewrite(nomfichier);
– Lire un enregistrement
read(buf, nomfichier)
– Ecrire ds le fichier
write(buf,nomfichier)
– Fermer un fichier
closefile;
– Fin de fichier :
eof(nomfichier)
{{{le Prog :}}}
program nomProg;
Uses nomBiblio;
begin
.
.
.
end.
Article lu 978 fois