Caractere
Commande de compilation
Dans le menu Project - References de Visual Basic,
il faut importer les déclarations du module Up ! Kernel en
cochant la case correspondante.
Commande d'enregistrement des ActiveX
upsvtm Com=Charger
Commande d'exécution
caractere.exe
Fichier source
Dim MUpsKrn As IUpsKrn
Private Sub EcrireEcran(ByVal Libelle As String)
' ==============================================
Ecran.AddItem Libelle
End Sub
Private Sub Form_Load()
' =====================
Dim C As IUpsKrnCaractere
Dim L As Integer
On Error GoTo GestionErreur
Set MUpsKrn = CreateObject("UpsApp.UpsKrn")
Set C = MUpsKrn.Caractere2(MUpsKrn.ComVariantBool2Booleen(True))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.Caractere5(MUpsKrn.ComInt2Entier(5))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.Caractere8(MUpsKrn.ComFloat2Reel(3.14159))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde")
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour").Additionner(MUpsKrn.ComBStr2Caractere(
Le")).Additionner(MUpsKrn.ComBStr2Caractere(" Monde"))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").Soustraire()
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
L = MUpsKrn.Entier2ComInt(MUpsKrn.ComBStr2Caractere("Bonjour").Longueur())
EcrireEcran Str$(L)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").Gauche(MUpsKrn.ComInt2Entier(5))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").Droite(MUpsKrn.ComInt2Entier(5))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").Milieu(MUpsKrn.ComInt2Entier(2),
MUpsKrn.ComInt2Entier(5))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").Majuscule()
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").MajMinuscule()
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").Minuscule()
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour monde").Inserer(MUpsKrn.ComBStr2Caractere(
le"), MUpsKrn.ComInt2Entier(7))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
L = MUpsKrn.Entier2ComInt(MUpsKrn.ComBStr2Caractere("Bonjour le monde").Compter(MUpsKrn.ComBStr2Caractere("o"),
MUpsKrn.ComInt2Entier(0)))
EcrireEcran Str$(L)
L = MUpsKrn.Entier2ComInt(MUpsKrn.ComBStr2Caractere("Bonjour le monde").Compter(MUpsKrn.ComBStr2Caractere("o"),
MUpsKrn.ComInt2Entier(4)))
EcrireEcran Str$(L)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour XYZT monde").Remplacer(MUpsKrn.ComBStr2Caractere("XYZT"),
MUpsKrn.ComBStr2Caractere("le"), MUpsKrn.ComInt2Entier(0))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour XYZT monde").Remplacer(MUpsKrn.ComBStr2Caractere("XYZT"),
MUpsKrn.ComBStr2Caractere("le"), MUpsKrn.ComInt2Entier(4))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").Ajouter(MUpsKrn.ComInt2Entier(20),
MUpsKrn.ComBStr2Caractere(" "))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").Ajouter(MUpsKrn.ComInt2Entier(20),
MUpsKrn.ComBStr2Caractere("."))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").AjouterGauche(MUpsKrn.ComInt2Entier(20),
MUpsKrn.ComBStr2Caractere(" "))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").AjouterGauche(MUpsKrn.ComInt2Entier(20),
MUpsKrn.ComBStr2Caractere("."))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").AjouterDroite(MUpsKrn.ComInt2Entier(20),
MUpsKrn.ComBStr2Caractere(" "))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde").AjouterDroite(MUpsKrn.ComInt2Entier(20),
MUpsKrn.ComBStr2Caractere("."))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere(" Bonjour le monde ").Supprimer(MUpsKrn.ComBStr2Caractere(
"))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("..Bonjour le monde..").Supprimer(MUpsKrn.ComBStr2Caractere("."))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere(" Bonjour le monde").SupprimerGauche(MUpsKrn.ComBStr2Caractere(
"))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("....Bonjour le monde").SupprimerGauche(MUpsKrn.ComBStr2Caractere("."))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde ").SupprimerDroite(MUpsKrn.ComBStr2Caractere(
"))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le monde....").SupprimerDroite(MUpsKrn.ComBStr2Caractere("."))
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
L =
MUpsKrn.Entier2ComInt(MUpsKrn.ComBStr2Caractere("Bonjour le monde").Compter(MUpsKrn.ComBStr2Caractere("o"),
MUpsKrn.ComInt2Entier(0)))
EcrireEcran Str$(L)
L = MUpsKrn.Entier2ComInt(MUpsKrn.ComBStr2Caractere("Bonjour le monde").Compter(MUpsKrn.ComBStr2Caractere("o"),
MUpsKrn.ComInt2Entier(3)))
EcrireEcran Str$(L)
Set C = MUpsKrn.ComBStr2Caractere("Bonjour le")
C.AdditionnerAffecter MUpsKrn.ComBStr2Caractere(" monde")
EcrireEcran MUpsKrn.Caractere2ComBStr(C)
Set C = MUpsKrn.ComBStr2Caractere("B")
Set C = C.Additionner(MUpsKrn.ComBStr2Caractere("B"))
If MUpsKrn.Booleen2ComVariantBool(C.Egal(MUpsKrn.ComBStr2Caractere("B")))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(C.Different(MUpsKrn.ComBStr2Caractere("B")))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(C.InferieurOuEgal(MUpsKrn.ComBStr2Caractere("B")))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(C.SuperieurOuEgal(MUpsKrn.ComBStr2Caractere("B")))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(C.Inferieur(MUpsKrn.ComBStr2Caractere("B")))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(C.Superieur(MUpsKrn.ComBStr2Caractere("B")))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(MUpsKrn.ComBStr2Caractere("B").Egal(C))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(MUpsKrn.ComBStr2Caractere("B").Different(C))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(MUpsKrn.ComBStr2Caractere("B").InferieurOuEgal(C))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(MUpsKrn.ComBStr2Caractere("B").SuperieurOuEgal(C))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(MUpsKrn.ComBStr2Caractere("B").Inferieur(C))
Then
End If
If MUpsKrn.Booleen2ComVariantBool(MUpsKrn.ComBStr2Caractere("B").Superieur(C))
Then
End If
Set C = MUpsKrn.ComBStr2Caractere("ab")
Set C = C.Additionner(MUpsKrn.ComBStr2Caractere("cd"))
If MUpsKrn.Booleen2ComVariantBool(C.IdentiqueMajMinuscule(MUpsKrn.ComBStr2Caractere("def")))
Then
Else
End If
If MUpsKrn.Booleen2ComVariantBool(C.IdentiqueMajMinuscule(MUpsKrn.ComBStr2Caractere("AbCd")))
Then
Else
End If
Set C = Nothing
Set MUpsKrn = Nothing
Exit Sub
GestionErreur:
'=============
EcrireEcran Erreur UpsKrn-0 : L'exception suivante a été envoyée dans le
source '" + Err.Source + "' :"
EcrireEcran Err.Description
End Sub