This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,3 @@
Cause a line printer attached to the computer to print a line containing the message <tt>Hello World!</tt>
'''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).

View file

@ -0,0 +1 @@
BEGIN { print("Hello World!") >"/dev/lp0" }

View file

@ -0,0 +1,17 @@
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;

View file

@ -0,0 +1,2 @@
PR#1
PRINT "HELLO WORLD!"

View file

@ -0,0 +1,2 @@
Fileappend, Hallo World!, print.txt
Run, print "print.txt"

View file

@ -0,0 +1 @@
LPRINT "Hello World!"

View file

@ -0,0 +1,3 @@
prn% = OPENOUT("PRN:")
PRINT #prn%, "Hello World!"
CLOSE #prn%

View file

@ -0,0 +1 @@
ECHO Hello world!>PRN

View file

@ -0,0 +1,10 @@
#include <iostream>
#include <fstream>
int main(){
std::ofstream lprFile;
lprFile.open( "/dev/lp0" );
lprFile << "Hello World\n";
lprFile.close();
return 0;
}

View file

@ -0,0 +1,10 @@
#include <stdio.h>
int main()
{
FILE *lp;
lp = fopen("/dev/lp0","w");
fprintf(lp,"Hello world!\n");
fclose(lp);
return 0;
}

View file

@ -0,0 +1,8 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. GOODBYE-WORLD-PRINTER.
PROCEDURE DIVISION.
DISPLAY 'Hello World!'
UPON PRINTER
END-DISPLAY.
STOP RUN.

View file

@ -0,0 +1,7 @@
import std.stdio;
void main()
{
auto lp = File("/dev/lp0", "w");
lp.writeln("Hello World!");
}

View file

@ -0,0 +1,14 @@
program Project1;
{$APPTYPE CONSOLE}
uses Printers;
var
lPrinterAsTextFile: TextFile;
begin
AssignPrn(lPrinterAsTextFile);
Rewrite(lPrinterAsTextFile);
Writeln(lPrinterAsTextFile, 'Hello World!');
CloseFile(lPrinterAsTextFile);
end.

View file

@ -0,0 +1,3 @@
( scratchpad ) USE: io.encodings.utf8
( scratchpad ) USE: io.launcher
( scratchpad ) "lpr" utf8 [ "Hello World!" print ] with-process-writer

View file

@ -0,0 +1,2 @@
Start,Programs,Accessories,Notepad,Type:Goodbye World[pling],
Menu:File,Print,Button:OK

View file

@ -0,0 +1,18 @@
package main
import (
"fmt"
"os"
)
func main() {
lp0, err := os.Create("/dev/lp0")
if err != nil {
panic(err)
}
defer lp0.Close()
fmt.Fprintln(lp0, "Hello world!")
}

View file

@ -0,0 +1 @@
new File('/dev/lp0').write('Hello World\n')

View file

@ -0,0 +1,5 @@
import System.Cmd
cmd = "echo \"Hello World!\" | lpr"
main = system cmd

View file

@ -0,0 +1,2 @@
require'print'
print'Hello world!'

View file

@ -0,0 +1,14 @@
import java.io.FileWriter;
import java.io.IOException;
public class LinePrinter {
public static void main(String[] args) {
try {
FileWriter lp0 = new FileWriter("/dev/lp0");
lp0.write("Hello World!");
lp0.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}

View file

@ -0,0 +1,6 @@
// This example runs on Node.js
var fs = require('fs');
// Assuming lp is at /dev/lp0
var lp = fs.openSync('/dev/lp0', 'w');
fs.writeSync(lp, 'Hello, world!\n');
fs.close(lp);

View file

@ -0,0 +1 @@
10 PRINT #8, "Hello World!"

View file

@ -0,0 +1,3 @@
fid = fopen('/dev/lp0');
fprintf(fid,'Hello World!\n');
fclose(fid);

View file

@ -0,0 +1,2 @@
commandstring = "echo Hello World! | lpr -P Printer01"
Run[commandstring]

View file

@ -0,0 +1,3 @@
<?php
file_put_contents('/dev/lp0', 'Hello world!');
?>

View file

@ -0,0 +1,5 @@
<?php
fclose(STDOUT);
$STDOUT = fopen('/dev/lp0', 'a');
echo 'Hello world!';
?>

View file

@ -0,0 +1,3 @@
open O, ">", "/dev/lp0";
print O "Hello World!\n";
close O;

View file

@ -0,0 +1,2 @@
(out '(lpr "-P" "Printer01")
(prinl "Hello world") )

View file

@ -0,0 +1,3 @@
lp = open("/dev/lp0")
lp.write("Hello World!/n")
lp.close()

View file

@ -0,0 +1,2 @@
str='Hello World'
'@ECHO' str ">PRN"

View file

@ -0,0 +1 @@
open("| lpr", "w") { |f| f.puts "Hello World!" }

View file

@ -0,0 +1,3 @@
(call-with-output-file "/dev/lp0"
  (lambda (printer)
    (write "Hello World!" printer)))

View file

@ -0,0 +1 @@
exec lp << "Hello World!"

View file

@ -0,0 +1,3 @@
set f [open |lp w]
puts $f "Hello World!"
close $f

View file

@ -0,0 +1,3 @@
set f [open prn w]
puts $f "Hello World!"
close $f