Caractere
Commande de compilation
javac -g -classpath ${UPS_HOME}/upsjav/upsjav/french/upsvtm.jar caractere.java
Commande d'exécution
java -classpath ${UPS_HOME}/upsjav/upsjav/french/upsvtm.jar;. -Djava.library.path=${UPS_HOME}/upsvtm/bin;${UPS_HOME}/upsnet/bin;${UPS_HOME}/upscmp/bin;${UPS_HOME}/upscom/bin;${UPS_HOME}/upscrb/bin;${UPS_HOME}/upsjav/bin;${UPS_HOME}/upsjav/bin/french caractere
Fichier source
import UpsKrn.Caractere;
import UpsKrn.Entier;
import UpsKrn.MUpsKrn;
import UpsKrn.UpsException;
public class caractere
/******************/
{
public static void main(String s[])
/*********************************/
{
Caractere C;
int L;
try
{
if (!MUpsKrn.Demarrer())
C=Caractere.Caractere2(MUpsKrn.JavaBoolean2Booleen(true));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=Caractere.Caractere5(MUpsKrn.JavaInt2Entier(5));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=Caractere.Caractere8(MUpsKrn.JavaFloat2Reel((float)3.14159));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde");
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour").Additionner(MUpsKrn.JavaString2Caractere(" Le")).Additionner(MUpsKrn.JavaString2Caractere(" Monde"));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").Soustraire();
System.out.println(MUpsKrn.Caractere2JavaString(C));
L=MUpsKrn.Entier2JavaInt(MUpsKrn.JavaString2Caractere("Bonjour").Longueur());
System.out.println(L);
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").Gauche(MUpsKrn.JavaInt2Entier(5));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").Droite(MUpsKrn.JavaInt2Entier(5));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").Milieu(MUpsKrn.JavaInt2Entier(2),MUpsKrn.JavaInt2Entier(5));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").Majuscule();
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").MajMinuscule();
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").Minuscule();
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour monde").Inserer(MUpsKrn.JavaString2Caractere(" le"),MUpsKrn.JavaInt2Entier(7));
System.out.println(MUpsKrn.Caractere2JavaString(C));
L=MUpsKrn.Entier2JavaInt(MUpsKrn.JavaString2Caractere("Bonjour le monde").Compter(MUpsKrn.JavaString2Caractere("o"),MUpsKrn.JavaInt2Entier(0)));
System.out.println(L);
L=MUpsKrn.Entier2JavaInt(MUpsKrn.JavaString2Caractere("Bonjour le monde").Compter(MUpsKrn.JavaString2Caractere("o"),MUpsKrn.JavaInt2Entier(4)));
System.out.println(L);
C=MUpsKrn.JavaString2Caractere("Bonjour XYZT monde").Remplacer(MUpsKrn.JavaString2Caractere("XYZT"),MUpsKrn.JavaString2Caractere("le"),MUpsKrn.JavaInt2Entier(0));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour XYZT monde").Remplacer(MUpsKrn.JavaString2Caractere("XYZT"),MUpsKrn.JavaString2Caractere("le"),MUpsKrn.JavaInt2Entier(4));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").Ajouter(MUpsKrn.JavaInt2Entier(20),MUpsKrn.JavaString2Caractere(" "));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").Ajouter(MUpsKrn.JavaInt2Entier(20),MUpsKrn.JavaString2Caractere("."));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").AjouterGauche(MUpsKrn.JavaInt2Entier(20),MUpsKrn.JavaString2Caractere(" "));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").AjouterGauche(MUpsKrn.JavaInt2Entier(20),MUpsKrn.JavaString2Caractere("."));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").AjouterDroite(MUpsKrn.JavaInt2Entier(20),MUpsKrn.JavaString2Caractere(" "));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde").AjouterDroite(MUpsKrn.JavaInt2Entier(20),MUpsKrn.JavaString2Caractere("."));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere(" Bonjour le monde ").Supprimer(MUpsKrn.JavaString2Caractere(" "));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("..Bonjour le monde..").Supprimer(MUpsKrn.JavaString2Caractere("."));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere(" Bonjour le monde").SupprimerGauche(MUpsKrn.JavaString2Caractere(" "));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("....Bonjour le monde").SupprimerGauche(MUpsKrn.JavaString2Caractere("."));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde ").SupprimerDroite(MUpsKrn.JavaString2Caractere(" "));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("Bonjour le monde....").SupprimerDroite(MUpsKrn.JavaString2Caractere("."));
System.out.println(MUpsKrn.Caractere2JavaString(C));
L=MUpsKrn.Entier2JavaInt(MUpsKrn.JavaString2Caractere("Bonjour le monde").Compter(MUpsKrn.JavaString2Caractere("o"),MUpsKrn.JavaInt2Entier(0)));
System.out.println(L);
L=MUpsKrn.Entier2JavaInt(MUpsKrn.JavaString2Caractere("Bonjour le monde").Compter(MUpsKrn.JavaString2Caractere("o"),MUpsKrn.JavaInt2Entier(3)));
System.out.println(L);
C=MUpsKrn.JavaString2Caractere("Bonjour le");
C.AdditionnerAffecter(MUpsKrn.JavaString2Caractere(" monde"));
System.out.println(MUpsKrn.Caractere2JavaString(C));
C=MUpsKrn.JavaString2Caractere("B");
C=C.Additionner(MUpsKrn.JavaString2Caractere("B"));
if (MUpsKrn.Booleen2JavaBoolean(C.Egal(MUpsKrn.JavaString2Caractere("B"))))
System.out.println("C==B");
if (MUpsKrn.Booleen2JavaBoolean(C.Different(MUpsKrn.JavaString2Caractere("B"))))
System.out.println("C!=B");
if (MUpsKrn.Booleen2JavaBoolean(C.InferieurOuEgal(MUpsKrn.JavaString2Caractere("B"))))
System.out.println("C<=B");
if (MUpsKrn.Booleen2JavaBoolean(C.SuperieurOuEgal(MUpsKrn.JavaString2Caractere("B"))))
System.out.println("C>=B");
if (MUpsKrn.Booleen2JavaBoolean(C.Inferieur(MUpsKrn.JavaString2Caractere("B"))))
System.out.println("C<B");
if (MUpsKrn.Booleen2JavaBoolean(C.Superieur(MUpsKrn.JavaString2Caractere("B"))))
System.out.println("C>B");
if (MUpsKrn.Booleen2JavaBoolean(MUpsKrn.JavaString2Caractere("B").Egal(C)))
System.out.println("B==C");
if (MUpsKrn.Booleen2JavaBoolean(MUpsKrn.JavaString2Caractere("B").Different(C)))
System.out.println("B!=C");
if (MUpsKrn.Booleen2JavaBoolean(MUpsKrn.JavaString2Caractere("B").InferieurOuEgal(C)))
System.out.println("B<=C");
if (MUpsKrn.Booleen2JavaBoolean(MUpsKrn.JavaString2Caractere("B").SuperieurOuEgal(C)))
System.out.println("B>=C");
if (MUpsKrn.Booleen2JavaBoolean(MUpsKrn.JavaString2Caractere("B").Inferieur(C)))
System.out.println("B<C");
if (MUpsKrn.Booleen2JavaBoolean(MUpsKrn.JavaString2Caractere("B").Superieur(C)))
System.out.println("B>C");
C=MUpsKrn.JavaString2Caractere("ab");
C=C.Additionner(MUpsKrn.JavaString2Caractere("cd"));
if (MUpsKrn.Booleen2JavaBoolean(C.IdentiqueMajMinuscule(MUpsKrn.JavaString2Caractere("def"))))
System.out.println("C==def");
else
System.out.println("C!=def");
if (MUpsKrn.Booleen2JavaBoolean(C.IdentiqueMajMinuscule(MUpsKrn.JavaString2Caractere("AbCd"))))
System.out.println("C==AbCd");
else
System.out.println("C!=AbCd");
MUpsKrn.Arreter();
}
catch (java.lang.Throwable e)
{
try
{
System.out.println("Erreur UpsKrn-0 : L'exception suivante a été envoyée dans le source '"
+e.NomSourceEnErreur+"' ligne "+e.NumeroLigne+", colonne "+e.NumeroColonne+" :");
System.out.println(e.MessageErreur);
}
catch (java.lang.Throwable e2)
{
System.out.println(e2.toString());
}
}
}
}