Allouer et Liberer

Commande de compilation...
Commande d'exécution...
Fichier source...

upscmp Source=allouer.upl

Revenir en haut de la page...

allouer

Revenir en haut de la page...

Source Composant "Exemple de l'emploi d'Allouer / Liberer" Version 1.0.0;

Type TA Defaut
/************/ Prive : Fin Type

Variable
Prive : Prive :
Fonction TA.Allouer() Retourner TA
/********************************/
Variable Debut
Si L!=Nul Alors Fin Si
Retourner Objet.Allouer();
Fin Fonction

Prive :
Procedure TA.Liberer()
/********************/
Debut
Si L==Nul Alors Fin Si
Si L.NbElements==10 Alors Fin Si
L=L+Objet;
Fin Procedure

Principal
Variable Debut
A=TA();
A.A=1;
Ecran.Ecrire(A.A);
B=TA();
B.A=2;
Ecran.Ecrire(B.A);
A=Nul;
A=TA();
A.A=3;
Ecran.Ecrire(A.A);
Fin Principal

Revenir en haut de la page...