Commande de compilation...
Commande d'exécution...
Fichier source...
upscmp Source=journal.upl Persistant=Oui
journal fichierpersistance=c:\tmp\journal.uof fichierjournal=c:\tmp\journal_kof
nbfichiersjournaux=2 maxfichierjournal=1 reprise=automatique
Source Composant "Exemple d'emploi des journaux et du mecanisme de
reprise" Version 1.0.0;
Type Employe Defaut Transactionnel
/********************************/
Nom : Caractere;
Numero : Entier;
Salaire : Reel;
Constructeur();
Fin Type
Variable
/******/
LE : Nul Ou ListeDe Employe;
Procedure CreerListeDEmployes()
/*****************************/
Variable
E : Nul Ou Employe;
Debut
E=Employe();
E.Nom="scott";
E.Numero=7724;
E.Salaire=1000.00;
LE=ListeDe(E);
E=Employe();
E.Nom="allen";
E.Numero=7832;
E.Salaire=1200.00;
LE+=E;
E=Employe();
E.Nom="smith";
E.Numero=7948;
E.Salaire=1400.00;
LE+=E;
E=Employe();
E.Nom="king";
E.Numero=7964;
E.Salaire=2000.00;
LE+=E;
TachePrincipale.TransactionCourante.Valider();
Fin Procedure
Procedure AugmenterSalaires()
/***************************/
Variable
E : Nul Ou Employe;
Debut
Pour E=LE.ParcoursAuDebut() JusquA LE.DernierElement() Faire
E.Salaire+=100.00;
Fin Pour
Attendre(1);
TachePrincipale.TransactionCourante.Valider();
Fin Procedure
Procedure ListerEmployes()
/************************/
Variable
E : Nul Ou Employe;
Debut
Pour E=LE.ParcoursAuDebut() JusquA LE.DernierElement() Faire
Ecran.Ecrire(E.Nom+" "+Caractere(E.Numero)+" "+Caractere(E.Salaire));
Fin Pour
Fin Procedure
Principal
/*******/
Debut
Si LE==Nul Alors
CreerListeDEmployes();
Fin Si
AugmenterSalaires();
ListerEmployes();
Fin Principal