Usage d'un module distribué

Commande de compilation...
Commande d'exécution...
Fichiers sources...

upscmp Source=libe AdaptateurServeurUpsNet=Oui

upscmp Source=serveur Lanceur=Serveur ModuleImplemente1=libe

upscmp Source=libe AdaptateurClientUpsNet=Oui

upscmp Source=client

Revenir en haut de la page...

upsorb PortUpsOrb=1632

serveur PortUpsOrb=1632 PortServeur=1640 NbServeurs=1

client PortUpsOrb=1632 PortServeur=1650 NbServeurs=1

Revenir en haut de la page...

Source Module "Exemple de module distribue" Version 1.0.0 ModuleDynamique Distribue UpsNet;

Composant Dans "c:/up/exemples/libe1.upl";
Source Composant "Exemple de module distribue" Version 1.0.0 RattacherA "c:/up/exemples/libe.upl";

Type T Defaut
/***********/
    TA : Booleen;
    TB : Nul Ou Booleen;
    TC : Entier;
    TD : Nul Ou Entier;
    TE : Reel;
    TF : Nul Ou Reel;
    TG : Caractere;
    Procedure TP1();
    Procedure TP2(P : Entier);
    Fonction TF1() Retourner Booleen;
    Fonction TF2(Prm1 : Booleen, Prm2 : Booleen Entree Sortie) Retourner Booleen;
    Fonction TF3() Retourner Entier;
    Fonction TF4(Prm1 : Entier, Prm2 : Entier Entree Sortie) Retourner Entier;
    Fonction TF5() Retourner Reel;
    Fonction TF6(Prm1 : Reel, Prm2 : Reel Entree Sortie) Retourner Reel;
    Fonction TF7() Retourner Caractere;
    Fonction TF8(Prm1 : Caractere, Prm2 : Caractere Entree Sortie) Retourner Caractere; Constructeur();
Fin Type
Variable
/******/
    A : Booleen;
    B : Nul Ou Booleen;
    C : Entier;
    D : Nul Ou Entier;
    E : Reel;
    F : Nul Ou Reel;
    G : Caractere;
    TabE : Tableau[3] De Nul Ou Entier;
    TabR : Tableau[3] De Nul Ou Reel;
Procedure T.TP1()
/***************/
Debut
Journal.Ecrire("TP1");
Fin Procedure

Procedure T.TP2(P : Entier)
***********************/
Debut
Journal.Ecrire("TP2 "+Caractere(P));
Fin Procedure

Fonction T.TF1() Retourner Booleen
/********************************/
Debut
Journal.Ecrire("TF1");
Retourner Vrai;
Fin Fonction

Fonction T.TF2(Prm1 : Booleen, Prm2 : Booleen Entree Sortie) Retourner Booleen
/************************************************************************/
Debut
Journal.Ecrire("TF2 "+Caractere(Prm1));
Prm2=Faux;
Retourner Faux;
Fin Fonction

Fonction T.TF3() Retourner Entier
/*******************************/
Debut
Journal.Ecrire("TF3");
Retourner 1;
Fin Fonction

Fonction T.TF4(Prm1 : Entier, Prm2 : Entier Entree Sortie) Retourner Entier
/*********************************************************************/
Debut
Journal.Ecrire("TF4 "+Caractere(Prm1));
Prm2=2;
Retourner 2;
Fin Fonction

Fonction T.TF5() Retourner Reel
/*****************************/
Debut
Journal.Ecrire("TF5");
Retourner 10.1;
Fin Fonction

Fonction T.TF6(Prm1 : Reel, Prm2 : Reel Entree Sortie) Retourner Reel
/***************************************************************/
Debut
Journal.Ecrire("TF6 "+Caractere(Prm1));
Prm2=11.2;
Retourner 11.2;
Fin Fonction

Fonction T.TF7() Retourner Caractere
/**********************************/
Debut
Journal.Ecrire("TF7");
Retourner "bonjour";
Fin Fonction

Fonction T.TF8(Prm1 : Caractere, Prm2 : Caractere Entree Sortie) Retourner Caractere
/******************************************************************************/
Debut
Journal.Ecrire("TF8 "+Prm1);
Prm2="coucou";
Retourner "coucou";
Fin Fonction

Procedure P1()
************/
Debut
Journal.Ecrire("P1");
Fin Procedure

Procedure P2(P : Entier)
/********************/
Debut
Journal.Ecrire("P2 "+Caractere(P));
Fin Procedure

Fonction F1() Retourner Booleen
/*****************************/
Debut
Journal.Ecrire("F1");
Retourner Vrai;
Fin Fonction

Fonction F2(Prm1 : Booleen, Prm2 : Booleen Entree Sortie) Retourner Booleen
/*********************************************************************/
Debut
Journal.Ecrire("F2 "+Caractere(Prm1));
Prm2=Faux;
Retourner Faux;
Fin Fonction

Fonction F3() Retourner Entier
/****************************/
Debut
Journal.Ecrire("F3");
Retourner 1;
Fin Fonction

Fonction F4(Prm1 : Entier, Prm2 : Entier Entree Sortie) Retourner Entier
/******************************************************************/
Debut
Journal.Ecrire("F4 "+Caractere(Prm1));
Prm2=2;
Retourner 2;
Fin Fonction

Fonction F5() Retourner Reel
/**************************/
Debut
Journal.Ecrire("F5");
Retourner 10.1;
Fin Fonction

Fonction F6(Prm1 : Reel, Prm2 : Reel Entree Sortie) Retourner Reel
/************************************************************/
Debut
Journal.Ecrire("F6 "+Caractere(Prm1));
Prm2=11.2;
Retourner 11.2;
Fin Fonction

Fonction F7() Retourner Caractere
/*******************************/
Debut
Journal.Ecrire("F7");
Retourner "bonjour";
Fin Fonction

Fonction F8(Prm1 : Caractere, Prm2 : Caractere Entree Sortie) Retourner Caractere
/***************************************************************************/
Debut
Journal.Ecrire("F8 "+Prm1);
Prm2="coucou";
Retourner "coucou";
Fin Fonction
Source Module "Exemple de module distribue" Version 1.0.0;

Principal
/*******/
Debut
TantQue Vrai Faire
    Attendre(1);
Fin TantQue
Fin Principal
Source Composant "Exemple d'emploi des modules distribues" Version 1.0.0;

ImporterModule LibE(<libe.upi>, ImporterDefinitions);

Variable
/******/
    H : Booleen;
    I : Entier;
    J : Reel;
    K : Caractere;
    L : T;
Principal
/*******/
Debut
A=Vrai;
Ecran.Ecrire(A);
B=Faux;
Ecran.Ecrire(B);
C=1;
Ecran.Ecrire(C);
D=2;
Ecran.Ecrire(D);
E=10.1;
Ecran.Ecrire(E);
F=11.2;
Ecran.Ecrire(F);
G="coucou";
Ecran.Ecrire(G);

P1();
P2(1);
H=F1();
Ecran.Ecrire(H);
Ecran.Ecrire(F2(Vrai, H));
Ecran.Ecrire(H);
I=F3();
Ecran.Ecrire(I);
Ecran.Ecrire(F4(1, I));
Ecran.Ecrire(I);
J=F5();
Ecran.Ecrire(J);
Ecran.Ecrire(F6(10.1, J));
Ecran.Ecrire(J);
K=F7();
Ecran.Ecrire(K);
Ecran.Ecrire(F8("coucou", K));
Ecran.Ecrire(K);

L.TA=Vrai;
Ecran.Ecrire(L.TA);
L.TB=Faux;
Ecran.Ecrire(L.TB);
L.TC=1;
Ecran.Ecrire(L.TC);
L.TD=2;
Ecran.Ecrire(L.TD);
L.TE=10.1;
Ecran.Ecrire(L.TE);
L.TF=11.2;
Ecran.Ecrire(L.TF);
L.TG="coucou";
Ecran.Ecrire(L.TG);

L.TP1();
L.TP2(1);
H=L.TF1();
Ecran.Ecrire(H);
Ecran.Ecrire(L.TF2(Vrai, H));
Ecran.Ecrire(H);
I=L.TF3();
Ecran.Ecrire(I);
Ecran.Ecrire(L.TF4(1, I));
Ecran.Ecrire(I);
J=F5();
Ecran.Ecrire(J);
Ecran.Ecrire(L.TF6(10.1, J));
Ecran.Ecrire(J);
K=L.TF7();
Ecran.Ecrire(K);
Ecran.Ecrire(L.TF8("coucou", K));
Ecran.Ecrire(K);

Ecran.Ecrire("\n");
Ecran.Ecrire(L.EstInstanceDe.NomType);
C+=10;
Ecran.Ecrire(C);
D+=10;
Ecran.Ecrire(D);
E+=100.01;
Ecran.Ecrire(E);
F+=100.01;
Ecran.Ecrire(F);
Ecran.Ecrire(C++);
Ecran.Ecrire(D--);
Ecran.Ecrire(++E);
Ecran.Ecrire(--F);
L.TC+=10;
Ecran.Ecrire(L.TC);
L.TD+=10;
Ecran.Ecrire(L.TD);
L.TE+=100.01;
Ecran.Ecrire(L.TE);
L.TF+=100.01;
Ecran.Ecrire(L.TF);
Ecran.Ecrire(L.TC++);
Ecran.Ecrire(L.TD--);
Ecran.Ecrire(++L.TE);
Ecran.Ecrire(--L.TF);

Ecran.Ecrire("\n");
TabE[0]=1;
TabE[1]=2;
TabE[2]=3;
Ecran.Ecrire(TabE[0]);
Ecran.Ecrire(TabE[1]);
Ecran.Ecrire(TabE[2]);
TabR[0]=1.1;
TabR[1]=2.2;
TabR[2]=3.3;
Ecran.Ecrire(TabR[0]);
Ecran.Ecrire(TabR[1]);
Ecran.Ecrire(TabR[2]);

TabE[0]+=100;
TabE[1]+=100;
TabE[2]+=100;
Ecran.Ecrire(TabE[0]);
Ecran.Ecrire(TabE[1]);
Ecran.Ecrire(TabE[2]);
TabR[0]+=100.01;
TabR[1]+=100.01;
TabR[2]+=100.01;
Ecran.Ecrire(TabR[0]);
Ecran.Ecrire(TabR[1]);
Ecran.Ecrire(TabR[2]);
Ecran.Ecrire(TabE[0]++);
Ecran.Ecrire(--TabE[1]);
Ecran.Ecrire(TabR[0]++);
Ecran.Ecrire(--TabR[1]);
Fin Principal

Revenir en haut de la page...