comp.lang.ada
 help / color / mirror / Atom feed
From: Manuel Gomez <mgrojo@gmail.com>
Subject: Re: problemn with string'last
Date: Fri, 5 May 2023 18:28:58 +0200	[thread overview]
Message-ID: <u33asa$2dofj$1@dont-email.me> (raw)
In-Reply-To: <u32okt$2aep1$1@dont-email.me>

El 5/5/23 a las 13:17, Jeffrey R.Carter escribió:
> On 2023-05-05 11:51, Daniel Gaudry wrote:
>>    Data         : constant String         := "  PLUS_STRING    : 
>> CONSTANT STRING(1..3) :=(1 =>'" & Double_Quote & "' , 2 =>'+' , 3 =>'" 
>> & Double_Quote & ");";
> 
> Wouldn't it be simpler and clearer to write this as
> 
> Data : constant String := "  PLUS_STRING : CONSTANT STRING := " & '"' & 
> '+' & '"';
> 
> ? Note also that you seem to be missing an apostrophe (''') before the 
> right parenthesis if you intend Data to be a valid Ada declaration.
> 

Or like this (doubling the quotes, which is the way to _escape_ the 
double quote inside Ada strings):

    Data         : constant String         := "  PLUS_STRING    : 
CONSTANT STRING(1..3) :=(1 =>'""' , 2 =>'+' , 3 =>'""');";

  parent reply	other threads:[~2023-05-05 16:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05  9:51 problemn with string'last Daniel Gaudry
2023-05-05 10:02 ` Dmitry A. Kazakov
2023-05-05 11:17 ` Jeffrey R.Carter
2023-05-05 12:08   ` Dmitry A. Kazakov
2023-05-05 16:28   ` Manuel Gomez [this message]
2023-05-05 16:33     ` Simon Wright
2023-05-05 18:18       ` Manuel Gomez
2023-05-05 19:52         ` J-P. Rosen
2023-05-05 20:44         ` Simon Wright
2023-05-05 23:27           ` Jeffrey R.Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox