Hello world/Line printer: Difference between revisions
Content added Content deleted
(Adding Ada example) |
|||
Line 3: | Line 3: | ||
'''Note:''' A line printer is not the same as standard output. A [[wp:line printer|line printer]] was an older-style printer which prints one line at a time to a continuous ream of paper. With some systems, a line printer can be any device attached to an appropriate port (such as a parallel port). |
'''Note:''' A line printer is not the same as standard output. A [[wp:line printer|line printer]] was an older-style printer which prints one line at a time to a continuous ream of paper. With some systems, a line printer can be any device attached to an appropriate port (such as a parallel port). |
||
=={{header|Ada}}== |
|||
===[[Unix]]=== |
|||
Assuming that the line printer is attached to /dev/lp0 |
|||
<lang Ada> |
|||
with Ada.Text_IO; use Ada.Text_IO; |
|||
procedure Print_Line is |
|||
Printer : File_Type; |
|||
begin |
|||
begin |
|||
Open (Printer, Mode => Out_File, Name => "/dev/lp0"); |
|||
exception |
|||
when others => |
|||
Put_Line ("Unable to open printer."); |
|||
return; |
|||
end; |
|||
Set_Output (Printer); |
|||
Put_Line ("Hello World!"); |
|||
Close (Printer); |
|||
end Print_Line; |
|||
</lang> |
|||
=={{header|Applesoft BASIC}}== |
=={{header|Applesoft BASIC}}== |