comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Anyway to change the length of a string ?
Date: 14 Aug 2002 16:39:31 -0400
Date: 2002-08-14T20:48:39+00:00	[thread overview]
Message-ID: <ufzxh18fw.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: ab6237e2.0208141156.1fd62e56@posting.google.com

genx54321@hotmail.com (Jim) writes:

> .... after you have already declared it before BEGIN ?
> 
> i am making a Hangman game with words up to 10 letters long.
> 
> now i declare a string which would be used in the program for the word
> which can be 1-10 letters.
> 
> so i say
> 
> s : string(1..10)
> 
> 
> but in the program i cant say
> 
> s:= "hello"

You can say 

S (1 .. 5) := "hello";

or

S := "hello" & "     ";

> because 's' has to be 10 characters long right ?
> 
> can i have it so i can change the length of 's' from 10 char to 5
> characters in the program and then input the value as "hello" ?

See the standard package Ada.Strings.Unbounded.

-- 
-- Stephe



  parent reply	other threads:[~2002-08-14 20:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-14 19:56 Anyway to change the length of a string ? Jim
2002-08-14 20:12 ` David C. Hoos
2002-08-14 20:39 ` Stephen Leake [this message]
2002-08-14 21:45 ` tmoran
  -- strict thread matches above, loose matches on Subject: below --
2002-08-14 21:31 Warren W. Gay VE3WWG
replies disabled

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