Bonjour à tous,
Est-il possible d'affecter une procédure à une variable de manière à pouvoir réaliser des constructions de ce type:
Et sinon, quelle solution permettrait d'aboutir au même résultat ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 PROCEDURE hello; BEGIN WRITELN('Hello') END; PROCEDURE repeter(action: procedure;n: INTEGER) VAR i: INTEGER; BEGIN FOR i:=1 TO n DO action END; BEGIN repeter(hello,3) END.
Merci d'avance,
Gauthier
Partager