Le fichier source est ${UPS_HOME}/upsvtm/demo/${UPS_LANGUAGE}/journal.upl.
upscmp Source=journal.upl Persistant=Oui
journal FichierPersistance=c:\tmp\journal.uwf FichierJournal=c:\tmp\journal.ulg NbFichiersJournaux=2 MaxFichierJournal=1 Reprise=Automatique
upssng Source=journal.upl Persistant=Oui FichierPersistance=c:\tmp\journal.uwf FichierJournal=c:\tmp\journal.ulg NbFichiersJournaux=2 MaxFichierJournal=1 Reprise=Automatique
Source Composant "Exemple d'emploi des journaux et du mecanisme de reprise" Version 4.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.0);
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