comp.lang.ada
 help / color / mirror / Atom feed
* How to put Floats in an Output File?
@ 2009-01-09 21:14 tolkamp
  2009-01-09 21:28 ` Adam Beneschan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: tolkamp @ 2009-01-09 21:14 UTC (permalink / raw)


I try to put float values into a file using the following code:

package Float_Io is new Text_Io.Float_Io (Float);

Outp_File  : File_Type;
Value : Float;
Create (Outp_File, Out_File, Outp_Filename);
Put (Outp_File, Float_Io.Put (Value));

Compilation results in the following error message:

no candidate interpretations match the actuals:
missing argument for parameter "Item" in call to Put
context requires function call, found procedure name



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to put Floats in an Output File?
  2009-01-09 21:14 How to put Floats in an Output File? tolkamp
@ 2009-01-09 21:28 ` Adam Beneschan
  2009-01-09 21:47 ` Robert A Duff
  2009-01-10  1:06 ` anon
  2 siblings, 0 replies; 5+ messages in thread
From: Adam Beneschan @ 2009-01-09 21:28 UTC (permalink / raw)


On Jan 9, 1:14 pm, tolkamp <f.tolk...@chello.nl> wrote:
> I try to put float values into a file using the following code:
>
> package Float_Io is new Text_Io.Float_Io (Float);
>
> Outp_File  : File_Type;
> Value : Float;
> Create (Outp_File, Out_File, Outp_Filename);
> Put (Outp_File, Float_Io.Put (Value));
>
> Compilation results in the following error message:
>
> no candidate interpretations match the actuals:
> missing argument for parameter "Item" in call to Put
> context requires function call, found procedure name


Float_IO.Put is a procedure, not a function.

                     -- Adam



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to put Floats in an Output File?
  2009-01-09 21:14 How to put Floats in an Output File? tolkamp
  2009-01-09 21:28 ` Adam Beneschan
@ 2009-01-09 21:47 ` Robert A Duff
  2009-01-10  1:06 ` anon
  2 siblings, 0 replies; 5+ messages in thread
From: Robert A Duff @ 2009-01-09 21:47 UTC (permalink / raw)


tolkamp <f.tolkamp@chello.nl> writes:

> Put (Outp_File, Float_Io.Put (Value));

You want this:

Float_Io.Put (Outp_File, Value);

You can also do this:

Put (Outp_File, Float'Image (Value));

- Bob



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to put Floats in an Output File?
  2009-01-09 21:14 How to put Floats in an Output File? tolkamp
  2009-01-09 21:28 ` Adam Beneschan
  2009-01-09 21:47 ` Robert A Duff
@ 2009-01-10  1:06 ` anon
  2009-01-10 11:15   ` tolkamp
  2 siblings, 1 reply; 5+ messages in thread
From: anon @ 2009-01-10  1:06 UTC (permalink / raw)


with Ada.Float_Text_IO ;

Ada.Float_Text_IO.Put ( File => Outp_File, Item => Value ) ;

-- or to user the standard output 

Ada.Float_Text_IO.Put ( Value ) ;

-- Of course you can add a few options to more control the format
-- of the output. Options: Fore, Aft, Exp 


In <e4441a73-0a37-49e5-b54b-b6d43dad4c87@a29g2000pra.googlegroups.com>, tolkamp <f.tolkamp@chello.nl> writes:
>I try to put float values into a file using the following code:
>
>package Float_Io is new Text_Io.Float_Io (Float);
>
>Outp_File  : File_Type;
>Value : Float;
>Create (Outp_File, Out_File, Outp_Filename);
>Put (Outp_File, Float_Io.Put (Value));
>
>Compilation results in the following error message:
>
>no candidate interpretations match the actuals:
>missing argument for parameter "Item" in call to Put
>context requires function call, found procedure name




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to put Floats in an Output File?
  2009-01-10  1:06 ` anon
@ 2009-01-10 11:15   ` tolkamp
  0 siblings, 0 replies; 5+ messages in thread
From: tolkamp @ 2009-01-10 11:15 UTC (permalink / raw)


On 10 jan, 02:06, a...@anon.org (anon) wrote:
> with Ada.Float_Text_IO ;
>
> Ada.Float_Text_IO.Put ( File => Outp_File, Item => Value ) ;
>
> -- or to user the standard output
>
> Ada.Float_Text_IO.Put ( Value ) ;
>
> -- Of course you can add a few options to more control the format
> -- of the output. Options: Fore, Aft, Exp
>
> In <e4441a73-0a37-49e5-b54b-b6d43dad4...@a29g2000pra.googlegroups.com>, tolkamp <f.tolk...@chello.nl> writes:
>
>
>
> >I try to put float values into a file using the following code:
>
> >package Float_Io is new Text_Io.Float_Io (Float);
>
> >Outp_File  : File_Type;
> >Value : Float;
> >Create (Outp_File, Out_File, Outp_Filename);
> >Put (Outp_File, Float_Io.Put (Value));
>
> >Compilation results in the following error message:
>
> >no candidate interpretations match the actuals:
> >missing argument for parameter "Item" in call to Put
> >context requires function call, found procedure name- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

Thank you for the solutions, these work perfect.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-01-10 11:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-09 21:14 How to put Floats in an Output File? tolkamp
2009-01-09 21:28 ` Adam Beneschan
2009-01-09 21:47 ` Robert A Duff
2009-01-10  1:06 ` anon
2009-01-10 11:15   ` tolkamp

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