comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: parsing a string
Date: 2000/01/24
Date: 2000-01-24T22:28:49+00:00	[thread overview]
Message-ID: <uu2k3kszb.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 86h42s$1ht$1@nnrp1.deja.com

pumilia@est.it writes:

> In article <85q63n$ese$1@bgtnsc01.worldnet.att.net>,

> Thank you for help. i have found the function Index, defined as follows
> 
>      function Index (Source   : in String;
>                    Pattern  : in String;
>                    Going    : in Direction := Forward;
>                    Mapping  : in Maps.Character_Mapping
>                                 := Maps.Identity)
>       return Natural;
> 
> in package Ada.Strings.Fixed
> 
> I guessed that the last two fields are set by default, so that it is
> possible not to pass them any value.
> Maybe it is a wrong guess, but i do not know what value can be
> passed for  Maps.Character_Mapping
> 
> Here is a selection from my test procedure 'dimer.adb', where the
> string output_file has been assigned by another procedure:
> 
>     with ada.strings.unbounded;
>     use ada.strings.unbounded;
>     with ada.strings.fixed; use ada.strings.fixed;
>      ...
>      output_file :  unbounded_string ;
>      part1_output_file :  string (1..25) ;
>      ...
>      output_file :=  to_string(output_file);
>      Index(part1_output_file,"put");
>      ...

Index is a function, which must be assigned to a value, so this can't
be the real source. Please include your _complete_ test program, so we
can compile it ourselves, to help get a good answer. 

The default for Map should be fine. You can find out what else you
might pass for Map in the package Ada.Strings.Maps.

-- Stephe




  parent reply	other threads:[~2000-01-24  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-15  0:00 parsing a string Paolo M. Pumilia
2000-01-15  0:00 ` James S. Rogers
2000-01-24  0:00   ` pumilia
2000-01-24  0:00     ` Ehud Lamm
2000-01-24  0:00     ` Stephen Leake [this message]
2000-01-26  0:00       ` CONTRAINT ERROR (was Re: parsing a string) pumilia
2000-01-26  0:00         ` Roger Racine
2000-01-26  0:00           ` Fraser
2000-01-26  0:00             ` Simon Wright
2000-01-26  0:00         ` John English
2000-01-26  0:00         ` Ian Clifton
2000-01-24  0:00   ` parsing a string pumilia
replies disabled

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