Re: Lenght check failed
[ Nouvelle discussion
| Répondre au groupe
|
fr.comp.lang.ada ]
On 9 fév, 18:07, "Jeffrey R. Carter"
<spam.jrcarter....@acm.nospam.org> wrote:
> Ludovic Brenta wrote:
>
> > with Ada.Strings.Unbounded;
> > procedure P is
> > Keyboard_Input : constant Ada.Strings.Unbounded.Unbounded_String :> >
Ada.Strings.Unbounded.Get_Line; -- longueur inconnue
> > S : constant String := Ada.Strings.Unbounded.To_String (Keyboard_Input);
> > begin
> > ...
> > end P;
>
> Plus simple:
>
> S : String := Ada.Text_IO.Get_Line;
>
>
>
> > Maintenant si tu veux un tableau de chaînes de longueurs variables
> > ("ragged array") il te faut un tableau de valeurs accès vers des
> > String. Par exemple:
>
> Plus simple (et sur) est un tableau d'Unbounded_String.
>
> --
> Jeff Carter
> "I soiled my armor, I was so scared."
> Monty Python & the Holy Grail
> 71
J'ai un problème que je n'avais jusqu'alors pas considéré, un
Ada.Strings.Unbounded.Length me donne la longueur d'une string.
Le problème est qu'il compte les caractères spéciaux (accents...)
comme deux.
Savez-vous comment bypasser ce problème ?
Merci

|
 cette fonctionnalité est reservée aux membres ayant une session active !
|