Re: Lenght check failed
[ Nouvelle discussion
| Répondre au groupe
|
fr.comp.lang.ada ]
Sujet: Re: Lenght check failed
De: spam.jrcarter....@acm.nospam.org (Jeffrey R. Carter)
Groupes: fr.comp.lang.ada
Organisation: AT&T ASP.att.net
Date: 11. Feb 2008, 00:48:58
References: 1 2 3 4 5
|
animatrix30@gmail.com wrote:
>
> 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.
Je n'ai pas vu ca.
with Ada.Strings.Unbounded;
with Ada.Text_IO;
procedure Unbounded_Length is
S : Ada.Strings.Unbounded.Unbounded_String :=
Ada.Strings.Unbounded.To_Unbounded_String ("éè");
begin -- Unbounded_Length
Ada.Text_IO.Put_Line
(Item => Integer'Image (Ada.Strings.Unbounded.Length (S) ) );
end Unbounded_Length;
GNATMAKE 3.4.2 (mingw-special) Copyright 1995-2004 Free Software Foundation, Inc.
"unbounded_length.ali" being checked ...
-> "unbounded_length.ali" missing.
gcc -c -Id:/code/ -gnatwu -O2 -gnatn -funroll-loops -g -gnato -fstack-check
-ID:\Code -g -I- d:/code/unbounded_length.adb
gnatbind -aO./ -ID:\Code -I- -x unbounded_length.ali
gnatlink unbounded_length.ali -g
D:\Code>unbounded_length
2
C'est un probleme de votre compilateur.
--
Jeff Carter
"Clear? Why, a 4-yr-old child could understand this
report. Run out and find me a 4-yr-old child. I can't
make head or tail out of it."
Duck Soup
94

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