Re: newbe: how to print integer and real numbers?



Amal schrieb:
Include STD.textio.all and use the image attribute to convert from
real/integer to string.

process
variable l : line;
variable r : real;
variable i : integer;
begin
-- real
write( l, real'image(r) );
writeline( output, l );

-- integer
write( l, integer'image(i) );
writeline( output, l );
end process;

thx, this is what i was looking for


--
Daniel
.



Relevant Pages

  • Re: help please! when a string contains variable references
    ... Maybe I'm just not smart enough to distill the actual problem from your ... elaborate: post some code and the error you are getting. ... evaluated into one string before it's passed on writeline? ... I want to use this variable as the argument for writeline like so: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: StreamWriter ?
    ... Write just writes, WriteLine() adds a \r\n, as Jerry mentioned. ... so you can iterate through the file like so. ... Microsoft Expression Web Bible (upcoming) ... Dim oldLinesas String = File.ReadAllLines ...
    (microsoft.public.dotnet.framework)
  • Re: how to write text in vhdl
    ... function that converts a std_logic_vector into a string. ... a limitation on 'report' you'd have the same issue with the writeline ... The nice thing about Ben's package is that you can just say ...
    (comp.lang.vhdl)
  • Re: StreamWriter.Write and WriteLine?
    ... If there is not a CRLF then the line never ... ends as far as the StreamReader is concerned. ... that the string is too long for line to hold? ... > StreamWriter's Write or WriteLine method? ...
    (microsoft.public.dotnet.languages.vb)
  • help please! when a string contains variable references
    ... I have a variable string, called formatstring The general format of the ... I want to use this variable as the argument for writeline like so: ...
    (microsoft.public.dotnet.languages.csharp)