Decoder et SiNul

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

upscmp Source=decoder.upl

Revenir en haut de la page...

decoder

Revenir en haut de la page...

Source Composant "Exemple d'emploi de SiNul" Version 1.0.0;

Fonction FA(A : Nul Ou Entier) Retourner Nul Ou Entier
/**************************************************/
Debut
Retourner A;
Fin Fonction

Fonction FB(B : Nul Ou Caractere) Retourner Nul Ou Caractere
/********************************************************/
Debut
Retourner B;
Fin Fonction

Fonction FC(C : Nul Ou Reel) Retourner Nul Ou Reel
/**********************************************/
Debut
Retourner C;
Fin Fonction

Fonction FD(D : Nul Ou Reel) Retourner Nul Ou Reel
/**********************************************/
Debut
Retourner D;
Fin Fonction

Principal
/*******/
Variable Debut
A=SiNul(1,2);
Ecran.Ecrire("A=");
Ecran.Ecrire(A);
A=SiNul(Nul, 2);
Ecran.Ecrire("A=");
Ecran.Ecrire(A);

B=SiNul("coucou", "hello");
Ecran.Ecrire("B=");
Ecran.Ecrire(B);
B=SiNul(Nul, "hello");
Ecran.Ecrire("B=");
Ecran.Ecrire(B);

C=SiNul(1.0, 2.0);
Ecran.Ecrire("C=");
Ecran.Ecrire(C);
C=SiNul(Nul, 2.0);
Ecran.Ecrire("C=");
Ecran.Ecrire(C);

D=SiNul(Vrai, Faux);
Ecran.Ecrire("D=");
Ecran.Ecrire(D);
D=SiNul(Nul, Faux);
Ecran.Ecrire("D=");
Ecran.Ecrire(D);

A=1;
E=Decoder(A, 1 , "coucou", 2, "hello", "guten tag");
Ecran.Ecrire("E1=");
Ecran.Ecrire(E);
A=2;
E=Decoder(A, 1, "coucou", 2, "hello", "guten tag");
Ecran.Ecrire("E2=");
Ecran.Ecrire(E);
A=3;
E=Decoder(A, 1, "coucou", 2, "hello", "guten tag");
Ecran.Ecrire("E3=");
Ecran.Ecrire(E);
E=Decoder(A, 1, "coucou", 2, "hello");
Ecran.Ecrire("E4=");
Ecran.Ecrire(E);
B="coucou";
F=Decoder(B, "coucou", 1.0, "hello", 2.0, 3.0);
Ecran.Ecrire("F1=");
Ecran.Ecrire(F);
B="hello";
F=Decoder(B, "coucou", 1.0, "hello" ,2.0, 3.0);
Ecran.Ecrire("F2=");
Ecran.Ecrire(F);
B="guten tag";
F=Decoder(B, "coucou", 1.0, "hello", 2.0, 3.0);
Ecran.Ecrire("F3=");
Ecran.Ecrire(F);
F=Decoder(B, "coucou", 1.0, "hello", 2.0);
Ecran.Ecrire("F4=");
Ecran.Ecrire(F);

C=1.0;
E=Decoder(C, 1.0, "coucou", 2.0, "hello", "guten tag");
Ecran.Ecrire("E1=");
Ecran.Ecrire(E);
C=2.0;
E=Decoder(C, 1.0, "coucou", 2.0, "hello", "guten tag");
Ecran.Ecrire("E2=");
Ecran.Ecrire(E);
C=3.0;
E=Decoder(C, 1.0, "coucou", 2.0, "hello", "guten tag");
Ecran.Ecrire("E3=");
Ecran.Ecrire(E);
E=Decoder(C, 1.0, "coucou", 2.0, "hello");
Ecran.Ecrire("E4=");
Ecran.Ecrire(E);
Fin Principal

Revenir en haut de la page...