fbpx
วิกิพีเดีย

โปรแกรมเฮลโลเวิลด์

โปรแกรมเฮลโลเวิลด์ เป็นโปรแกรมคอมพิวเตอร์พื้นฐานที่ทำการแสดงผลคำว่า "Hello, World!" บนอุปกรณ์แสดงผล ซึ่งเป็นหนึ่งในโปรแกรมที่ง่ายที่สุดเท่าที่จะเป็นไปได้ในการเขียนภาษาโปรแกรมต่าง ๆ และมักถูกใช้เป็นตัวอย่างที่ง่ายที่สุดในการแสดงวากยสัมพันธ์ของภาษาโปรแกรมหนึ่ง ๆ โดยมักจะเป็นโปรแกรมแรกที่ผู้เริ่มต้นเขียนโปรแกรมเขียนออกมา นอกจากนี้ โปรแกรมเฮลโลเวิลด์ ยังสามารถใช้เพื่อตรวจสอบเบื้องต้นได้ว่า เครื่องมือของภาษาโปรแกรมถูกติดตั้งอย่างสมบูรณ์หรือไม่

ประวัติ

โปรแกรมเฮลโลเวิลด์โปรแกรมแรกเกิดขึ้น จากหนังสือการเขียนโปรแกรมภาษาซี แต่งโดยไบรอัน เคอร์นิงแฮน และ เดนนิส ริตชี ตีพิมพ์ในปี พ.ศ. 2521 (ค.ศ. 1978) โดยตัวอย่างโปรแกรมมาจาก กระดาษจดข้อมูลของไบรอันขณะที่ทำงานที่ เบลล์แล็บ (Bell Laboratories) ปี พ.ศ. 2517 (ค.ศ. 1974) ตัวอย่างในหนังสือ พิมพ์ข้อความว่า "hello, world" (โดยไม่ใช้ตัวพิมพ์ใหญ่และเครื่องหมายตกใจ ซึ่งได้ถูกเพิ่มมาในภายหลัง)

main( ) { printf("hello, world\n"); } 

การเขียนคำนี้ มีการใช้งานโดยเขียนหลายแบบคือ ตัวอักษร H ใหญ่ และ h เล็ก ขณะเดียวกับ W ใหญ่ และ w เล็ก รวมถึงการเขียนเครื่องหมาย และแบบไม่มีเครื่องหมาย

การเขียนชุดคำสั่งนี้ในขณะที่บางโปรแกรมสามารถใช้คำสั่งได้อย่างเรียบง่าย ในขณะที่บางโปรแกรมต้องใช้คำสั่งซับซ้อนในการแสดงผล โดยเฉพาะอย่างยิ่งที่ใช้ GUI โปรแกรมเฮลโลเวิลด์มีประโยชน์ในการทดสอบว่าคอมไพเลอร์และส่วนต่างๆหลักของโปรแกรมทำงานได้ การรวบรวมคำสั่ง "hello world" ในภาษาโปรแกรมต่าง ๆ ถูกใช้ในการช่วยเรียน และการเปรียบเทียบการใช้งานของภาษาต่างๆ

ตัวอย่างของ Hello world ในภาษาโปรแกรมต่าง ๆ

4GL - Computer Associates with Ingres/DB

message "Hello, World!" with style = popup; 

ABAP - SAP AG

REPORT ZELLO. WRITE 'Hello, World!'. 

ABC

WRITE "Hello, world!" 

Ada

with Ada.Text_IO; procedure Hello is begin Ada.Text_IO.Put_Line ("Hello, world!") ; end Hello; 

For explanation see wikibooks:Ada Programming:Basic.

ALGOL 68

In the popular upper-case stropping convention for bold words:

BEGIN print (("Hello, World!", newline)) END 

or using prime stropping suitable for punch cards:

'BEGIN' PRINT (("HELLO, WORLD!", NEWLINE)) 'END' 

or minimally using the short form of begin and end, and implied newline at program termination:

( print ("Hello, World!") ) 

AmigaE

PROC main () WriteF ('Hello, World!') ; ENDPROC 

APL

'Hello World' 

AppleScript

See also GUI section.

return "Hello World!" 

ASP

<% Response.Write ("Hello World") %> 
or simply:
<%="Hello World" %> 

ASP.NET

Response.Write ("Hello World") 

Assembly language

Accumulator-only architecture: DEC PDP-8, PAL-III assembler

See the example section of the PDP-8 article.

First successful µP/OS combinations: Intel 8080/Zilog Z80, CP/M, RMAC assembler

bdos equ 0005H  ; BDOS entry point start: mvi c,9  ; BDOS function: output string lxi d,msg$  ; address of msg call bdos ret  ; return to CCP msg$: db 'Hello, world!$' end start 

Accumulator + index register machine: MOS Technology 6502, CBM KERNAL, ca65 assembler

MSG: .ASCIIZ "Hello, world!" LDX #$F3 @LP: LDA MSG-$F3,X ; load character JSR $FFD2  ; CHROUT (KERNAL) , output to current output device (screen) INX BNE @LP  ; RTS 

Accumulator/Index microcoded machine: Data General Nova, RDOS

See the example section of the Nova article.

Expanded accumulator machine: Intel x86, DOS, TASM

MODEL SMALL IDEAL STACK 100H DATASEG MSG DB 'Hello, world!', 13, '$' CODESEG Start: MOV AX, @data MOV DS, AX MOV DX, OFFSET MSG MOV AH, 09H  ; DOS: output ASCII$ string INT 21H MOV AX, 4C00H INT 21H END Start 

Expanded accumulator machine: Intel x86, Microsoft Windows, FASM

Assumes that enviromnent variable %fasminc% is set
format PE GUI 4.0 include '%fasminc%\win32a.inc' section '.code' code readable executable invoke MessageBox,0,hellomsg,hellolb,MB_OK+MB_ICONINFORMATION invoke ExitProcess,0 section '.data' data readable writable hellomsg db 'Hello, World!',0 hellolb db 'Hello World',0 data import library user32,'user32.dll',kernel32,'kernel32.dll' include '%fasminc%\apia\user32.inc' include '%fasminc%\apia\kernel32.inc' end data 

Expanded accumulator machine: Intel x86, Linux, GAS

.data msg: .ascii "Hello, world!\n" len = . - msg .text .global _start _start: movl $len,%edx movl $msg,%ecx movl $1,%ebx movl $4,%eax int $0x80 movl $0,%ebx movl $1,%eax int $0x80 

General-purpose fictional computer: MIX, MIXAL

TERM EQU 19 console device no. (19 = typewriter) ORIG 1000 start address START OUT MSG (TERM) output data at address MSG HLT  halt execution MSG ALF "HELLO" ALF " WORL" ALF "D " END START end of program 

General-purpose fictional computer: MMIX, MMIXAL

string BYTE "Hello, world!",#a,0 string to be printed (#a is newline and 0 terminates the string)

 Main GETA $255,string get the address of the string in register 255 TRAP 0,Fputs,StdOut put the string pointed to by register 255 to file StdOut TRAP 0,Halt,0  end process 

General-purpose-register CISC: DEC PDP-11, RT-11, MACRO-11

.MCALL .REGDEF,.TTYOUT,.EXIT .REGDEF HELLO: MOV #MSG,R1 MOVB (R1) ,R0 LOOP: .TTYOUT MOVB + (R1) ,R0 BNE LOOP .EXIT MSG: .ASCIZ /HELLO, WORLD!/ .END HELLO 

CISC on advanced multiprocessing OS: DEC VAX, VMS, MACRO-32

.title hello

 .psect data, wrt, noexe chan: .blkw 1 iosb: .blkq 1 term: .ascid "SYS$OUTPUT" msg: .ascii "Hello, world!" len = . - msg .psect code, nowrt, exe .entry hello, ^m<>  ; Establish a channel for terminal I/O $assign_s devnam=term, -  chan=chan blbc r0, end  ; Queue the I/O request $qiow_s chan=chan, -  func=#io$_writevblk, -  iosb=iosb, -  p1=msg, -  p2=#len  ; Check the status and the IOSB status blbc r0, end movzwl iosb, r0  ; Return to operating system end: ret .end hello 

RISC processor: ARM, RISC OS, BBC BASIC's in-line assembler

.program  ADR R0,message SWI "OS_Write0" SWI "OS_Exit" .message  DCS "Hello, world!" DCB 0  ALIGN 

หรือเวอร์ชันย่อ (จาก qUE) ;

 SWI"OS_WriteS":EQUS"Hello, world!":EQUB0:ALIGN:MOVPC,R14 

AutoHotkey

MsgBox, "Hello, World!"

Autoit

MsgBox (1,'','Hello, world!')

AWK

BEGIN { print "Hello, world!" } 

Bash

echo Hello,\ world! 

BASIC

General

The following example works for any ANSI/ISO-compliant BASIC implementation, as well as most implementations built into or distributed with microcomputers in the 1970s and 1980s (usually some variant of Microsoft BASIC) :

10 PRINT "Hello, world!" 20 END 

Such implementations of BASIC could also execute instructions in an immediate mode when line numbers are omitted. The following examples work without requiring a RUN instruction.

PRINT "Hello, world!" ? "Hello, world!" 

Later implementations of BASIC allowed greater support for structured programming and did not require line numbers for source code. The following example works when RUN for the vast majority of modern BASICs.

PRINT "Hello, world!" END 

Again, the "END" statement is optional in many BASICs.

PBASIC

DEBUG "Hello, world!", CR 

or, the typical microcontroller Hello World program equivalent with the only output device present being a light-emitting diode (LED) (in this case attached to the seventh output pin) :

DO HIGH 7 'Make the 7th pin go high (turn the LED on) PAUSE 500 'Sleep for half a second LOW 7 ' Make the 7th pin go low (turn the LED off) PAUSE 500 'Sleep for half a second LOOP END 

StarOffice/OpenOffice Basic

sub main print "Hello, World" end sub 

TI-BASIC

On TI calculators of the TI-80 through TI-86 range:

:Disp "HELLO, WORLD!"  or :Output (x,y,"HELLO, WORLD!") or :Text (x,y,"HELLO, WORLD!") or :Text (-1,x,y,"HELLO, WORLD!") ;only on the 83+ and higher 

or simply

:"HELLO, WORLD!" 

On TI-89/TI-92 (+) /Voyage 200 calculators:

:hellowld () :Prgm :Disp "Hello, world!" :EndPrgm 

Visual Basic

Sub Main MsgBox "Hello World!" End Sub 

Visual Basic .NET

Module HelloWorldApp Sub Main () System.Console.WriteLine ("Hello, world!") End Sub End Module 

or, defined differently,

Class HelloWorldApp Shared Sub Main () System.Console.WriteLine ("Hello, world!") End Sub End Class 

Blitz BASIC

Print "Hello, World!"

DarkBASIC

PRINT "HELLO WORLD"

TEXT 0,0,"Hello World" WAIT KEY 

BCPL

GET "LIBHDR"

LET START () BE $ ( WRITES ("Hello, world!*N") $) 

BLISS

%TITLE 'HELLO_WORLD' MODULE HELLO_WORLD (IDENT='V1.0', MAIN=HELLO_WORLD, ADDRESSING_MODE (EXTERNAL=GENERAL)) = BEGIN LIBRARY 'SYS$LIBRARY:STARLET'; EXTERNAL ROUTINE LIB$PUT_OUTPUT; GLOBAL ROUTINE HELLO_WORLD = BEGIN LIB$PUT_OUTPUT (%ASCID %STRING ('Hello World!')) END; END ELUDOM 

boo

See also GUI Section.

print "Hello, world!" 


Casio FX-9750

This program will work on the fx-9750 graphing calculator and compatibles.

"HELLO WORLD" 

C

#include <stdio.h> int main() { printf("Hello, world!"); return 0; } 

Ch

The above C code can run in Ch as examples. The simple one in Ch is:

 printf ("Hello, world\n") ; 


C#

See also GUI Section.

class HelloWorldApp { static void Main () { System.Console.WriteLine ("Hello, world!") ; } } 

C++

#include <iostream> using namespace std; int main () { cout << "Hello, world!\n"; } 

C++/CLI

int main () { System::Console::WriteLine ("Hello, world!") ; } 

C++, Managed (.NET)

#using <mscorlib.dll> using namespace System; int wmain () { Console::WriteLine ("Hello, world!") ; } 

ColdFusion (CFM)

<cfoutput>Hello, world!</cfoutput> 

COMAL

PRINT "Hello, World!" 

CIL

.method public static void Main () cil managed { .entrypoint .maxstack 8 ldstr "Hello, world!" call void [mscorlib]System.Console::WriteLine (string) ret } 

Clean

module hello Start = "Hello, world" 

CLIST

PROC 0 WRITE Hello, World! 

Clipper

@1,1 say "Hello World!" 

COBOL

IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. ENVIRONMENT DIVISION. DATA DIVISION. PROCEDURE DIVISION. DISPLAY "Hello, world!". STOP RUN. 


D

import std.stdio; void main () { writefln ("Hello, world!") ; } 

DC an arbitrary precision calculator

[Hello, world!]p 

DCL batch

$ write sys$output "Hello, world!" 

DOLL

// The program is itself an object. The program "this" object can be overloaded // as a function that work as "main" function in a C program. this () { system.stdout ("Hello, World!") ; } 

Dylan

module: hello format-out ("Hello, world!\n") ; 

Ed and Ex (Ed extended)

a hello world! . p 

Eiffel

class HELLO_WORLD creation make feature make is local  io:BASIC_IO do  !!io  io.put_string ("%N Hello, world!") end -- make end -- class HELLO_WORLD 

Erlang

-module (hello). -export ([hello_world/0]). hello_world () -> io:fwrite ("Hello, world!\n"). 

Euphoria

puts (1, "Hello, world!") 

F#

print_endline "Hello world" 

Factor

"Hello world" print 

filePro

@once mesgbox "Hello, world!" exit 

Fjölnir

"hello" < main { main -> stef (;) stofn skrifastreng (;"Halló Veröld!") , stofnlok } * "GRUNNUR" ; 

FOCAL

type "Hello, World!",! 

or

t "Hello, World!",! 

Focus

-TYPE Hello World 

Forte TOOL

begin TOOL HelloWorld; includes Framework; HAS PROPERTY IsLibrary = FALSE; forward Hello; -- START CLASS DEFINITIONS class Hello inherits from Framework.Object has public method Init; has property shared= (allow=off, override=on) ; transactional= (allow=off, override=on) ; monitored= (allow=off, override=on) ; distributed= (allow=off, override=on) ; end class; -- END CLASS DEFINITIONS -- START METHOD DEFINITIONS ------------------------------------------------------------ method Hello.Init begin super.Init () ; task.Part.LogMgr.PutLine ('HelloWorld!') ; end method; -- END METHOD DEFINITIONS HAS PROPERTY CompatibilityLevel = 0; ProjectType = APPLICATION; Restricted = FALSE; MultiThreaded = TRUE; Internal = FALSE; LibraryName = 'hellowor'; StartingMethod = (class = Hello, method = Init) ; end HelloWorld; 

Forth

: halloforth ( -- ) ." Hello, world!" CR ; 

FORTRAN

 PROGRAM HELLO PRINT *, 'Hello, world!' END 

Fril

 ? ((pp "Hello, world!")) 

Frink

println["Hello, world!"] 

Gambas

See also GUI section.

PUBLIC SUB Main () Print "Hello, world!" END 

Game Maker

In the draw event of some object:

draw_text (x,y,"Hello World") 

Or to show a splash screen message:

show_message ("Hello World") 

Haskell

module Main (main) where main = putStrLn "Hello World" 

or

main = putStrLn "Hello World" 

Heron

program HelloWorld; functions { _main () { print_string ("Hello, world!") ; } } end 

HP-41 & HP-42S

(Handheld Hewlett-Packard RPN-based alphanumeric engineering calculators.)

01 LBLTHELLO 02 THELLO, WORLD 03 PROMPT 

 

HyperTalk (Apple HyperCard's scripting programming language)

put "Hello world" 

or

Answer "Hello World"

IDL

print,"Hello world!" 

Inform

[ Main; print "Hello, world!^"; ]; 

Io

"Hello world!" print 

or

write ("Hello world!\n") 

Iptscrae

ON ENTER { "Hello, " "World!" & SAY } 

J

Simplest:

 Hello World 

Probably closest in semantics:

'Hello World' 

Jal

include 16f877_20

 include hd447804 hd44780_clear hd44780 = "H" hd44780 = "e" hd44780 = "l" hd44780 = "l" hd44780 = "o" hd44780 = " " hd44780 = "W" hd44780 = "o" hd44780 = "r" hd44780 = "l" hd44780 = "d" hd44780 = "!" 

Java

See also GUI section.

public class Work_name_or_tag { public static void main (String[] args) { System.out.println ("Hello, world!") ; } } 

Java byte-code

(disassembler output of javap -c Hello.class)

public class Hello extends java.lang.Object { public Hello () ; public static void main (java.lang.String[]) ; } Method Hello () 0 aload_0 1 invokespecial #1 <Method java.lang.Object () > 4 return Method void main (java.lang.String[]) 0 getstatic #2 <Field java.io.PrintStream out> 3 ldc #3 <String "Hello, world!"> 5 invokevirtual #4 <Method void println (java.lang.String) > 8 return 

K

`0:"Hello world\n" 

Kogut

WriteLine "Hello, world!" 

Lisp

Lisp has many dialects that have appeared over its almost fifty-year history.

Common Lisp

(format t "Hello world!~%") 

or

(write-line "Hello World!") 

or merely:

 "Hello World!" 


Scheme

(display "Hello, world!") (newline) 

Emacs Lisp

 (print "Hello World") 

print [hello world!] 

or

pr [Hello World!] 

In mswlogo only

messagebox [Hi] [Hello World] 

Lua

print "Hello, world!" 

LuaPSP

screen:print (1,1,"Hello, world!") screen:flip () 

M (MUMPS)

W "Hello, world!" 

Macsyma, Maxima

print ("Hello, world!") $ 

Maple

print ("Hello, World!") ; 

Mathematica

Print["Hello World"] 

MATLAB

disp ('Hello World') 

Max

max v2; #N vpatcher 10 59 610 459; #P message 33 93 63 196617 Hello world!; #P newex 33 73 45 196617 loadbang; #P newex 33 111 31 196617 print; #P connect 1 0 2 0; #P connect 2 0 0 0; #P pop; 

Modula-2

MODULE Hello; FROM Terminal2 IMPORT WriteLn; WriteString; BEGIN WriteString ("Hello, world!") ; WriteLn; END Hello; 

MOO

notify (player, "Hello, world!") ; 

MS-DOS batch

(with the standard command.com interpreter. The @ symbol is optional and prevents the system from repeating the command before executing it. The @ symbol must be omitted on versions of MS-DOS prior to 3.0.)

@echo Hello, world! 

MUF

: main me @ "Hello, world!" notify ; 

Natural

WRITE "Hello, World!" END 

Nemerle

The easiest way to get Nemerle print "Hello, world!" would be that:

System.Console.WriteLine ("Hello, world!") ; 

however, in bigger applications the following code would be probably more useful:

using System.Console; module HelloWorld { Main () :void { WriteLine ("Hello, world!") ; } } 


Oberon

Oberon is both the name of a programming language and an operating system.

Program written for the Oberon operating system:

MODULE Hello; IMPORT Oberon, Texts; VAR W: Texts.Writer; PROCEDURE World*; BEGIN Texts.WriteString (W, "Hello World!") ; Texts.WriteLn (W) ; Texts.Append (Oberon.Log, W.buf) END World; BEGIN Texts.OpenWriter (W) END Hello. 

Freestanding Oberon program using the standard Oakwood library:

MODULE Hello; IMPORT Out; BEGIN Out.String ("Hello World!") ; Out.Ln END Hello. 

Objective C

Functional C Version

#import <stdio.h> int main () { printf ( "Hello, World!\n" ) ; return 0; } 

Object-Oriented C Version

  1. import <stdio.h>
//An object-oriented version. @interface Hello : Object { const char str[] = "Hello world"; } - (id) hello (void) ; @end @implementation Hello - (id) hello (void) { printf ("%s\n", str) ; } @end int main (void) { Hello *h = [Hello new]; [h hello]; [h free]; return 0; } 

OPENSTEP/Cocoa Version

  1. import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) { NSLog (@"Hello, World!") ; return 0; } 

OCaml

print_endline "Hello world!" 

OPL

See also GUI section.

PROC hello: PRINT "Hello, World" ENDP 

OPS5

(object-class request ^action) (startup (strategy MEA) (make request ^action hello) ) (rule hello (request ^action hello) (write |Hello World!| (crlf)) ) 

OPS83

module hello (main) { procedure main ( ) { write () |Hello, world!|, '\n'; }; }; 

Parrot assembly language

print "Hello, world!\n" end 

Pascal

program hello (output) ;
begin
writeln ('Hello, world!')
end.


Perl

print "Hello, world!\n"; 

(This is the first example in Learning Perl; the semicolon is optional.)

Perl 6

say "Hello World";

PHP

Hello, world! 

or

<?php echo "Hello, world!\n"; ?> 

or

<?="Hello, world!\n"?> 

(Note: This will not work unless short open tags are enabled.)

Pike

int main () { write ("Hello, world!\n") ; return 0; } 

PL/SQL

-- start anonymous block set serveroutput on size 10000000; begin dbms_output.enable (1000000) ; dbms_output.put_line ('Hello World!') ; end; -- end anonymous block 

PL/I

Test: proc options (main) reorder; put skip edit ('Hello, world!') (a) ; end Test; 

POP-11

'Hello world' => 

PostScript

See PDL section

Processing

println ("Hello, world!") ; 

Prolog

write ('Hello, world') ,nl. 

Python

print "Hello, world!" 

หรือใน Python 3.x

print("Hello, world!") 

REFAL

$ENTRY GO{=<Prout 'Hello, world!'>;} 

REXX, ARexx, NetRexx, and Object REXX

say "Hello, world!" 

RPL

See also GUI section.

(On Hewlett-Packard HP-28, HP-48 and HP-49 series graphing calculators.)

<< CLLCD "Hello, world!" 1 DISP 0 WAIT DROP >> 

Ruby

See also GUI section.

puts "Hello, world!" 

SAS

data _null_; put 'Hello, world!'; run; 

Sather

class HELLO_WORLD is main is #OUT+"Hello, world\n"; end; end; 

Scala (programming language)

object HelloWorld with Application { Console.println ("Hello, world!") ; } 

Scriptol

print "Hello world!" 

sed

(note: requires at least one line of input)

sed -ne '1s/.*/Hello, world!/p' 

Seed7

$ include "seed7_05.s7i";

 const proc: main is func begin writeln ("Hello, world!") ; end func; 

Self

'Hello, World!' print. 

Simula

BEGIN

 OutText ("Hello, world!") ; OutImage; END 

Smalltalk

Transcript show: 'Hello, world!'; cr 

SML

print "Hello, world!\n"; 

SNOBOL

 OUTPUT = "Hello, world!" END 

Span

class Hello { static public main: args { Console << "Hello, world!\n"; } } 

SPARK

with Spark_IO; --# inherit Spark_IO; --# main_program; procedure Hello_World --# global in out Spark_IO.Outputs; --# derives Spark_IO.Outputs from Spark_IO.Outputs; is begin Spark_IO.Put_Line (Spark_IO.Standard_Output, "Hello, world!", 0) ; end Hello_World; 

SPITBOL

 OUTPUT = "Hello, world!" END 

SQL

CREATE TABLE message (text char (15)) ; INSERT INTO message (text) VALUES ('Hello, world!') ; SELECT text FROM message; DROP TABLE message; 

or (e.g. Oracle dialect)

SELECT 'Hello, world!' FROM dual; 

or (for Oracle's PL/SQL proprietary procedural language)

BEGIN DBMS_OUTPUT.ENABLE (1000000) ; DBMS_OUTPUT.PUT_LINE ('Hello World, from PL/SQL') ; END; 

or (e.g. MySQL or PostgreSQL dialect)

SELECT 'Hello, world!'; 

or (e.g. T-SQL dialect)

PRINT 'Hello, world!' 

or (for KB-SQL dialect)

select Null from DATA_DICTIONARY.SQL_QUERY FOOTER or HEADER or DETAIL or FINAL event write "Hello, world!" 

STARLET

RACINE: HELLO_WORLD. NOTIONS: HELLO_WORLD : ecrire ("Hello, world!"). 

TACL

#OUTPUT Hello, world! 

Tcl (Tool command language)

See also GUI section.

puts "Hello, world!" 

Turing

put "Hello, world!" 

TSQL

Declare @Output varchar (16) Set @Output='Hello, world!' Select @Output 

or, simpler variations:

Select 'Hello, world!' Print 'Hello, world!' 

UNIX-style shell

echo 'Hello, world!' 

or

printf '%s' $'Hello, world!\n' 

or for a curses interface:

dialog --msgbox 'Hello, world!' 0 0 

Visual Prolog console program

#include @"pfc\console\console.ph" goal console::init () , stdio::write ("Hello World!"). 

Graphical user interfaces (GUIs)

ActionScript (Macromedia flash mx)

 this.createTextField ("hello_txt",0,10,10,100,20) ;
this.hello_txt.text="Hello, world";

AppleScript

See also TUI section.

display dialog "Hello World!" buttons {"OK"} default button 1

Or to have the OS synthesize it and literally speak out the words "hello world!" (with no comma, as that would cause the synthesizer to pause)

say "Hello world!" 

boo

See also TUI section.

import System.Drawing import System.Windows.Forms f = Form () f.Controls.Add (Label (Text: "Hello, World!", Location: Point (40,30))) f.Controls.Add (Button (Text: "Ok", Location: Point (50, 55) , Click: {Application.Exit () })) Application.Run (f) 

Functional equivalent of C# program below.

C#

See also TUI section.

using System; using System.Drawing; using System.Windows.Forms; class HelloWorldForm : Form { public static void Main () { Application.Run (new HelloWorldForm ()) ; } public HelloWorldForm () { Label label = new Label () ; label.Text = "Hello, World!"; label.Location = new Point (40,30) ; Controls.Add (label) ; Button button = new Button () ; button.Text = "OK"; button.Location = new Point (50,55) ; Controls.Add (button) ; button.Click += new EventHandler (OnButtonOk) ; } void OnButtonOk (Object sender, EventArgs e) { Application.Exit () ; } } 

or ||

using System; using System.Drawing; using System.Windows.Forms; namespace HelloWorld { public class HelloWorld : Form { public HelloWorld () {  ShowMessage () ; }  [STAThread] static void Main () {  Application.Run (new HelloWorld ()) ; }  private void ShowMessage () {  MessageBox.Show (  "Hello World!!!",  "Hello World - C#",  MessageBoxButtons.OK,  MessageBoxIcon.Information,  MessageBoxDefaultButton.Button1 ) ; } } } 

Cocoa or GNUStep (In Objective C)

#import <Cocoa/Cocoa.h>

@interface hello : NSObject { } @end @implementation hello - (void) awakeFromNib { NSBeep () ; // we don't need this but it's conventional to beep  // when you show an alert NSRunAlertPanel (@"Message from your Computer", @"Hello, world!", @"Hi!",  nil, nil) ; } @end 

Curl

{curl 3.0, 4.0 applet} {curl-file-attributes character-encoding = "utf-8"} Hello, world! 

Delphi, Kylix

program Hello_World; uses Windows; begin ShowMessage ("Hello, world!") ; end. 

Euphoria

MS-Windows only - basic.

include msgbox.e if message_box ("Hello, world!", "Hello", 0) then end if 

MS-Windows only - using Win32Lib library

include win32lib.ew createForm ({ ";Window; Hello", ";Label; Hello, World!" }) include w32start.ew 

FLTK2 (in C++)

#include <fltk/Window.h> #include <fltk/Widget.h> #include <fltk/run.h> using namespace fltk; int main (int argc, char **argv) { Window *window = new Window (300, 180) ; window->begin () ; Widget *box = new Widget (20, 40, 260, 100, "Hello, World!") ; box->box (UP_BOX) ; box->labelfont (HELVETICA_BOLD_ITALIC) ; box->labelsize (36) ; box->labeltype (SHADOW_LABEL) ; window->end () ; window->show (argc, argv) ; return run () ; } 

Gambas

See also TUI section.

PUBLIC SUB Main () Message.Info ("Hello, world!") END 

GTK+ (in C++)

#include <iostream> #include <gtkmm/main.h> #include <gtkmm/button.h> #include <gtkmm/window.h> using namespace std; class HelloWorld : public Gtk::Window { public: HelloWorld () ; virtual ~HelloWorld () ; protected: Gtk::Button m_button; virtual void on_button_clicked () ; }; HelloWorld::HelloWorld () : m_button ("Hello, world!") { set_border_width (10) ; m_button.signal_clicked ().connect (SigC::slot (*this,    &HelloWorld::on_button_clicked)) ; add (m_button) ; m_button.show () ; } HelloWorld::~HelloWorld () {} void HelloWorld::on_button_clicked () { cout << "Hello, world!" << endl; } int main (int argc, char *argv[]) { Gtk::Main kit (argc, argv) ; HelloWorld helloworld; Gtk::Main::run (helloworld) ; return 0; } 

GTK+ (in Python)

from gtk import *

window = Window (WINDOW_TOPLEVEL) window.set_title ("Hello World!") window.connect ("destroy", main_quit) window.add (VBox ()) window.child.pack_start (Label ("Hello World!")) button=Button ("OK") window.child.pack_end (button) button.connect ("clicked", main_quit) window.show_all () main () 

or

import gtk gtk.MessageDialog (message_format="Hello World!").run () 

Gtk# (in C#)

using Gtk;

using GtkSharp; using System; class Hello { static void Main () { Application.Init () ; Window window = new Window ("") ; window.DeleteEvent += cls_evn; Button close = new Button ("Hello World") ; close.Clicked += new EventHandler (cls_evn) ; window.Add (close) ; window.ShowAll () ;  Application.Run () ; } static void cls_evn (object obj, EventArgs args) { Application.Quit () ; } } 

GTK+ 2.x (in Euphoria)

include gtk2/wrapper.e Info (NULL,"Hello","Hello World!") 

Java

See also TUI section.

import javax.swing.JOptionPane; public class Hello { public static void main (String[] args) { JOptionPane.showMessageDialog (null, "Hello, world!!") ; } } 

 

Java applet

Java applets work in conjunction with HTML files.
<HTML> <HEAD> <TITLE>Hello World</TITLE> </HEAD> <BODY> HelloWorld Program says: <APPLET CODE="HelloWorld.class" WIDTH=600 HEIGHT=100> </APPLET> 


</BODY> </HTML> 
import import public class HelloWorld extends Applet { public void paint (Graphics g) { g.drawString ("Hello, world!", 100, 50) ; } } 

JavaScript and JScript

JavaScript (an implementation of ECMAScript) is a client-side scripting language used in HTML files. The following code can be placed in any HTML file: { alert ("Hello, world!") ; } //--></script> <a href="#" onclick="helloWorld () ; return false;">Hello World Example</a>
An easier method uses JavaScript implicitly, directly calling the reserved alert function. Cut and paste the following line inside the <body> .... </body> HTML tags.
<a href="#" onclick="alert ('Hello, world!') ; return false;">Hello World Example </a> 
An even easier method involves using popular browsers' support for the virtual 'javascript' protocol to execute JavaScript code. Enter the following as an Internet address (usually by pasting into the address box) :
javascript:alert ('Hello, world!') ; 
There are many other ways:
javascript:document.write ('Hello, world!\n') ; 

K

This creates a window labeled "Hello world" with a button labeled "Hello world".

hello:hello..l:"Hello world" hello..c:`button `show$`hello 

OPL

See also TUI section.

(On Psion Series 3 and later compatible PDAs.)

PROC guihello: ALERT ("Hello, world!","","Exit") ENDP 

or

PROC hello: dINIT "Window Title" dTEXT "","Hello World" dBUTTONS "OK",13 DIALOG ENDP 

Qt toolkit (in C++)

#include <qapplication.h> #include <qpushbutton.h> #include <qwidget.h> #include <iostream> class HelloWorld : public QWidget { Q_OBJECT public: HelloWorld () ; virtual ~HelloWorld () ; public slots: void handleButtonClicked () ; QPushButton *mPushButton; }; HelloWorld::HelloWorld () : QWidget () , mPushButton (new QPushButton ("Hello, World!", this)) { connect (mPushButton, SIGNAL (clicked ()) , this, SLOT (handleButtonClicked ())) ; } HelloWorld::~HelloWorld () {} void HelloWorld::handleButtonClicked () { std::cout << "Hello, World!" << std::endl; } int main (int argc, char *argv[]) { QApplication app (argc, argv) ; HelloWorld helloWorld; app.setMainWidget (&helloWorld) ; helloWorld.show () ; return app.exec () ; } 

or

#include <QApplication> #include <QPushButton> int main (int argc, char *argv[]) { QApplication app (argc, argv) ; QPushButton hello ("Hello world!") ; hello.resize (100, 30) ; hello.show () ; hello.connect (&hello, SIGNAL (clicked ()) , SLOT (close ())) ; return app.exec () ; } 

REAL

RPL

See also TUI section.

(On Hewlett-Packard


RTML

Hello ()

TEXT "Hello, world!" 

Ruby with WxWidgets

See also TUI section.

require 'wxruby' class HelloWorldApp < Wx::App def on_init ourFrame = Wx::Frame.new (nil, -1, "Hello, world!").show ourDialogBox = Wx::MessageDialog.new (ourFrame, "Hello, world!", "Information:", \  Wx::OK|Wx::ICON_INFORMATION).show_modal end end HelloWorldApp.new.main_loop 


Ruby with GTK+

See also TUI section.

require 'gtk2' Gtk.init window = Gtk::Window.new window.signal_connect ("delete_event") { Gtk.main_quit; false } button = Gtk::Button.new ("Hello World") button.signal_connect ("clicked") { Gtk.main_quit; false } window.add (button) window.show_all Gtk.main 

SWT (in Java)

import org.eclipse.swt.SWT; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Label; public class SWTHello { public static void main (String [] args) { Display display = new Display () ; final Shell shell = new Shell (display) ; RowLayout layout = new RowLayout () ; layout.justify = true; layout.pack = true; shell.setLayout (layout) ; 

Tcl/Tk

See also TUI section.

label .l -text "Hello, world!" pack .l 

Python with Tkinter

See also TUI section.

import Tkinter r = Tkinter.Tk () w = Tkinter.Label (r, text="Hello, world!") w.pack () r.mainloop () 

or, more primitively:

import 

Visual Basic including VBA

Sub Main () MsgBox "Hello, world!" End Sub 

Visual Prolog note box

#include @"pfc\vpi\vpi.ph" goal vpiCommonDialogs::note ("Hello World!"). 

Windows API (in C)

This uses the Windows API to create a full window containing the text. Another example below uses the built-in MessageBox function instead.

#include <windows.h> LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM) ; char szClassName[] = "MainWnd"; int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,  int nCmdShow) { HWND hwnd; MSG msg; WNDCLASSEX wincl; wincl.cbSize = sizeof (WNDCLASSEX) ; wincl.cbClsExtra = 0; wincl.cbWndExtra = 0; wincl.style = 0; wincl.hInstance = hInstance; wincl.lpszClassName = szClassName; wincl.lpszMenuName = NULL; //No menu wincl.lpfnWndProc = WindowProcedure; wincl.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1) ; //Color of the window wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; //EXE icon wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION) ; //Small program icon wincl.hCursor = LoadCursor (NULL, IDC_ARROW) ; //Cursor if (!RegisterClassEx (&wincl)) return 0; hwnd = CreateWindowEx (0, //No extended window styles szClassName, //Class name "", //Window caption WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, //Let Windows decide the left and top    //positions of the window 120, 50, //Width and height of the window, NULL, NULL, hInstance, NULL) ; //Make the window visible on the screen ShowWindow (hwnd, nCmdShow) ; //Run the message loop while (GetMessage (&msg, NULL, 0, 0) >0) { TranslateMessage (&msg) ; DispatchMessage (&msg) ; } return msg.wParam; } LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message,   WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; HDC hdc; switch (message) { case WM_PAINT: hdc = BeginPaint (hwnd, &ps) ; TextOut (hdc, 15, 3, "Hello, world!", 13) ; EndPaint (hwnd, &ps) ; break; case WM_DESTROY: PostQuitMessage (0) ; break; default: return DefWindowProc (hwnd, message, wParam, lParam) ; } return 0; } 

Or, much more simply:

#include <windows.h> int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpCmdLine,  int nCmdShow) { MessageBox (NULL, "Hello, world!", "", MB_OK) ; return 0; } 

Windows Script Host with VBScript

<job id="HelloWorld"> <script language="VBScript">  WScript.Echo "Hello, world!" </script> </job> 

Windows Script Host with JScript

<job id="HelloWorld"> <script language="JScript">  WScript.Echo ( "Hello, world!" ) ; </script> </job> 

XSL (T)

There are many ways to do this in XSL, the simplest being:

<xsl:template match="/"> <xsl:text>Hello, world!</xsl:text> </xsl:template> 

If nested similar to the HTML version, it would be:

<xsl:template match="/"> <html> <body> <h1>Hello, world!</h1> </body> </html> </xsl:template> 

XUL

Type the following in a text file (e.g. hello.world.xul) and then open with Mozilla Firefox.

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <box align="center" pack="center" flex="1"> <description>Hello, world</description> </box> </window> 

Esoteric programming languages

See: Hello world program in esoteric languages

Document formats

ASCII

The following sequence of characters, expressed in hexadecimal notation (with carriage return and newline characters at end of sequence) :

48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21 0D 0A 

The following sequence of characters, expressed as binary numbers (with cr/nl as above, and the same ordering of bytes) :

00–07: 01001000 01100101 01101100 01101100 01101111 00101100 00100000 01110111 08–0E: 01101111 01110010 01101100 01100100 00100001 00001101 00001010 

LaTeX 2ε

\documentclass{article} \begin{document} Hello, world! \end{document} 

Page description languages

XHTML 1.1

(Using UTF-8 character set.)

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Hello, world!</title> </head> <body> <p>Hello, world!</p> </body> </html> 

HTML

(simple)

<html><body> <h1>Hello, world!</h1> </body></html> 

<html> and <body>-tags are not necessary for informal testing. You could even use the following:

<pre>Hello, World!</pre> 

or simply write it as text without tags.

=== HTML 4.01 Strict=== (full)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Hello, World!</title> </head> <body> <p>Hello, world!</p> </body> </html> 

Notice that the HEAD tag is optional and could be omitted. The first paragraph of the W3C Recommendation on The global structure of an HTML document also features this example.


PDF

%PDF-1.0 1 0 obj << /Type /Catalog /Pages 3 0 R /Outlines 2 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Count 1 /Kids [4 0 R] >> endobj 4 0 obj << /Type /Page /Parent 3 0 R /Resources << /Font << /F1 7 0 R >>/ProcSet 6 0 R >> /MediaBox [0 0 612 792] /Contents 5 0 R >> endobj 5 0 obj << /Length 44 >> stream BT /F1 24 Tf 100 100 Td (Hello World) Tj ET endstream endobj 6 0 obj [/PDF /Text] endobj 7 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /MacRomanEncoding >> endobj xref 0 8 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000179 00000 n 0000000322 00000 n 0000000415 00000 n 0000000445 00000 n trailer << /Size 8 /Root 1 0 R >> startxref 553 %%EOF 


PostScript

% Displays on console. (Hello world!) = %! % Displays as page output. /Courier findfont 24 scalefont setfont 100 100 moveto (Hello world!) show showpage 

RTF

{\rtf1\ansi\deff0 {\fonttbl {\f0 Courier New;}} \f0\fs20 Hello, world! } 

TeX

Hello World \bye 

Media-based scripting languages

AviSynth

BlankClip () Subtitle ("Hello, world!") 

(Creates a video with default properties)

Lingo (Macromedia Director scripting language)

on exitFrame me put "Hello, World!" end 

Outputs the string to the message window if placed in a single movie frame. Alternatively, to display an alert box stating the message you could use

on exitFrame me alert "Hello, World!" end 

POV-Ray

#include "colors.inc" camera { location <3, 1, -10> look_at <3,0,0> } light_source { <500,500,-1000> White } text { ttf "timrom.ttf" "Hello world!" 1, 0 pigment { White } } 

โปรแกรมเฮลโลเว, ลด, หน, าน, เน, อหาเป, นภาษาต, างประเทศ, ณสามารถช, วยพ, ฒนาหน, าน, ได, วยการแปล, ยกเว, นหากเน, อหาเก, อบท, งหมดไม, ใช, ภาษาไทย, ให, แจ, งลบแทน, เป, นโปรแกรมคอมพ, วเตอร, นฐานท, ทำการแสดงผลคำว, hello, world, บนอ, ปกรณ, แสดงผล, งเป, นหน, งในโปรแกร. hnanimienuxhaepnphasatangpraeths khunsamarthchwyphthnahnaniiddwykaraepl ykewnhakenuxhaekuxbthnghmdimichphasaithy ihaecnglbaethnopraekrmehlolewild epnopraekrmkhxmphiwetxrphunthanthithakaraesdngphlkhawa Hello World bnxupkrnaesdngphl sungepnhnunginopraekrmthingaythisudethathicaepnipidinkarekhiynphasaopraekrmtang aelamkthukichepntwxyangthingaythisudinkaraesdngwakysmphnthkhxngphasaopraekrmhnung odymkcaepnopraekrmaerkthiphuerimtnekhiynopraekrmekhiynxxkma nxkcakni opraekrmehlolewild yngsamarthichephuxtrwcsxbebuxngtnidwa ekhruxngmuxkhxngphasaopraekrmthuktidtngxyangsmburnhruxim enuxha 1 prawti 2 twxyangkhxng Hello world inphasaopraekrmtang 2 1 4GL Computer Associates with Ingres DB 2 2 ABAP SAP AG 2 3 ABC 2 4 Ada 2 5 ALGOL 68 2 6 AmigaE 2 7 APL 2 8 AppleScript 2 9 ASP 2 10 ASP NET 2 11 Assembly language 2 11 1 Accumulator only architecture DEC PDP 8 PAL III assembler 2 11 2 First successful µP OS combinations Intel 8080 Zilog Z80 CP M RMAC assembler 2 11 3 Accumulator index register machine MOS Technology 6502 CBM KERNAL ca65 assembler 2 11 4 Accumulator Index microcoded machine Data General Nova RDOS 2 11 5 Expanded accumulator machine Intel x86 DOS TASM 2 11 6 Expanded accumulator machine Intel x86 Microsoft Windows FASM 2 11 7 Expanded accumulator machine Intel x86 Linux GAS 2 11 8 General purpose fictional computer MIX MIXAL 2 11 9 General purpose fictional computer MMIX MMIXAL 2 11 10 General purpose register CISC DEC PDP 11 RT 11 MACRO 11 2 11 11 CISC on advanced multiprocessing OS DEC VAX VMS MACRO 32 2 11 12 RISC processor ARM RISC OS BBC BASIC s in line assembler 2 12 AutoHotkey 2 13 Autoit 2 14 AWK 2 15 Bash 2 16 BASIC 2 16 1 General 2 16 2 PBASIC 2 16 3 StarOffice OpenOffice Basic 2 16 4 TI BASIC 2 16 5 Visual Basic 2 16 6 Visual Basic NET 2 16 7 Blitz BASIC 2 16 8 DarkBASIC 2 17 BCPL 2 18 BLISS 2 19 boo 2 20 Casio FX 9750 2 21 C 2 22 Ch 2 23 C 2 24 C 2 25 C CLI 2 26 C Managed NET 2 27 ColdFusion CFM 2 28 COMAL 2 29 CIL 2 30 Clean 2 31 CLIST 2 32 Clipper 2 33 COBOL 2 34 D 2 35 DC an arbitrary precision calculator 2 36 DCL batch 2 37 DOLL 2 38 Dylan 2 39 Ed and Ex Ed extended 2 40 Eiffel 2 41 Erlang 2 42 Euphoria 2 43 F 2 44 Factor 2 45 filePro 2 46 Fjolnir 2 47 FOCAL 2 48 Focus 2 49 Forte TOOL 2 50 Forth 2 51 FORTRAN 2 52 Fril 2 53 Frink 2 54 Gambas 2 55 Game Maker 2 56 Haskell 2 57 Heron 2 58 HP 41 amp HP 42S 2 59 HyperTalk Apple HyperCard s scripting programming language 2 60 IDL 2 61 Inform 2 62 Io 2 63 Iptscrae 2 64 J 2 65 Jal 2 66 Java 2 66 1 Java byte code 2 67 K 2 68 Kogut 2 69 Lisp 2 69 1 Common Lisp 2 69 2 Scheme 2 69 3 Emacs Lisp 2 70 Logo 2 71 Lua 2 71 1 LuaPSP 2 72 M MUMPS 2 73 Macsyma Maxima 2 74 Maple 2 75 Mathematica 2 76 MATLAB 2 77 Max 2 78 Modula 2 2 79 MOO 2 80 MS DOS batch 2 81 MUF 2 82 Natural 2 83 Nemerle 2 84 Oberon 2 85 Objective C 2 85 1 Functional C Version 2 85 2 Object Oriented C Version 2 85 3 OPENSTEP Cocoa Version 2 86 OCaml 2 87 OPL 2 88 OPS5 2 89 OPS83 2 90 Parrot assembly language 2 91 Pascal 2 92 Perl 2 93 Perl 6 2 94 PHP 2 95 Pike 2 96 PL SQL 2 97 PL I 2 98 POP 11 2 99 PostScript 2 100 Processing 2 101 Prolog 2 102 Python 2 103 REFAL 2 104 REXX ARexx NetRexx and Object REXX 2 105 RPL 2 106 Ruby 2 107 SAS 2 108 Sather 2 109 Scala programming language 2 110 Scriptol 2 111 sed 2 112 Seed7 2 113 Self 2 114 Simula 2 115 Smalltalk 2 116 SML 2 117 SNOBOL 2 118 Span 2 119 SPARK 2 120 SPITBOL 2 121 SQL 2 122 STARLET 2 123 TACL 2 124 Tcl Tool command language 2 125 Turing 2 126 TSQL 2 127 UNIX style shell 2 128 Visual Prolog console program 3 Graphical user interfaces GUIs 3 1 ActionScript Macromedia flash mx 3 2 AppleScript 3 3 boo 3 4 C 3 5 Cocoa or GNUStep In Objective C 3 6 Curl 3 7 Delphi Kylix 3 8 Euphoria 3 9 FLTK2 in C 3 10 Gambas 3 11 GTK in C 3 12 GTK in Python 3 13 Gtk in C 3 14 GTK 2 x in Euphoria 3 15 Java 3 16 Java applet 3 17 JavaScript and JScript 3 18 K 3 19 OPL 3 20 Qt toolkit in C 3 21 REAL 3 22 RPL 3 23 RTML 3 24 Ruby with WxWidgets 3 25 Ruby with GTK 3 26 SWT in Java 3 27 Tcl Tk 3 28 Python with Tkinter 3 29 Visual Basic including VBA 3 30 Visual Prolog note box 3 31 Windows API in C 3 32 Windows Script Host with VBScript 3 33 Windows Script Host with JScript 3 34 XSL T 3 35 XUL 4 Esoteric programming languages 5 Document formats 5 1 ASCII 5 2 LaTeX 2e 6 Page description languages 6 1 XHTML 1 1 6 2 HTML 6 3 PDF 6 4 PostScript 6 5 RTF 6 6 TeX 7 Media based scripting languages 7 1 AviSynth 7 2 Lingo Macromedia Director scripting language 7 3 POV Rayprawti aekikhopraekrmehlolewildopraekrmaerkekidkhun cakhnngsuxkarekhiynopraekrmphasasi aetngodyibrxn ekhxrningaehn aela ednnis ritchi tiphimphinpi ph s 2521 kh s 1978 odytwxyangopraekrmmacak kradascdkhxmulkhxngibrxnkhnathithanganthi ebllaelb Bell Laboratories pi ph s 2517 kh s 1974 twxyanginhnngsux phimphkhxkhwamwa hello world odyimichtwphimphihyaelaekhruxnghmaytkic sungidthukephimmainphayhlng main printf hello world n karekhiynkhani mikarichnganodyekhiynhlayaebbkhux twxksr H ihy aela h elk khnaediywkb W ihy aela w elk rwmthungkarekhiynekhruxnghmay aelaaebbimmiekhruxnghmaykarekhiynchudkhasngniinkhnathibangopraekrmsamarthichkhasngidxyangeriybngay inkhnathibangopraekrmtxngichkhasngsbsxninkaraesdngphl odyechphaaxyangyingthiich GUI opraekrmehlolewildmipraoychninkarthdsxbwakhxmiphelxraelaswntanghlkkhxngopraekrmthanganid karrwbrwmkhasng hello world inphasaopraekrmtang thukichinkarchwyeriyn aelakarepriybethiybkarichngankhxngphasatangtwxyangkhxng Hello world inphasaopraekrmtang aekikh4GL Computer Associates with Ingres DB aekikh message Hello World with style popup ABAP SAP AG aekikh REPORT ZELLO WRITE Hello World ABC aekikh WRITE Hello world Ada aekikh with Ada Text IO procedure Hello is begin Ada Text IO Put Line Hello world end Hello For explanation see wikibooks Ada Programming Basic ALGOL 68 aekikh In the popular upper case stropping convention for bold words BEGIN print Hello World newline END or using prime stropping suitable for punch cards BEGIN PRINT HELLO WORLD NEWLINE END or minimally using the short form of begin and end and implied newline at program termination print Hello World AmigaE aekikh PROC main WriteF Hello World ENDPROC APL aekikh Hello World AppleScript aekikh See also GUI section return Hello World ASP aekikh lt Response Write Hello World gt or simply lt Hello World gt ASP NET aekikh Response Write Hello World Assembly language aekikh Accumulator only architecture DEC PDP 8 PAL III assembler aekikh See the example section of the PDP 8 article First successful µP OS combinations Intel 8080 Zilog Z80 CP M RMAC assembler aekikh bdos equ 0005H BDOS entry point start mvi c 9 BDOS function output string lxi d msg address of msg call bdos ret return to CCP msg db Hello world end start Accumulator index register machine MOS Technology 6502 CBM KERNAL ca65 assembler aekikh MSG ASCIIZ Hello world LDX F3 LP LDA MSG F3 X load character JSR FFD2 CHROUT KERNAL output to current output device screen INX BNE LP RTS Accumulator Index microcoded machine Data General Nova RDOS aekikh See the example section of the Nova article Expanded accumulator machine Intel x86 DOS TASM aekikh MODEL SMALL IDEAL STACK 100H DATASEG MSG DB Hello world 13 CODESEG Start MOV AX data MOV DS AX MOV DX OFFSET MSG MOV AH 09H DOS output ASCII string INT 21H MOV AX 4C00H INT 21H END Start Expanded accumulator machine Intel x86 Microsoft Windows FASM aekikh Assumes that enviromnent variable fasminc is setformat PE GUI 4 0 include fasminc win32a inc section code code readable executable invoke MessageBox 0 hellomsg hellolb MB OK MB ICONINFORMATION invoke ExitProcess 0 section data data readable writable hellomsg db Hello World 0 hellolb db Hello World 0 data import library user32 user32 dll kernel32 kernel32 dll include fasminc apia user32 inc include fasminc apia kernel32 inc end data Expanded accumulator machine Intel x86 Linux GAS aekikh data msg ascii Hello world n len msg text global start start movl len edx movl msg ecx movl 1 ebx movl 4 eax int 0x80 movl 0 ebx movl 1 eax int 0x80 General purpose fictional computer MIX MIXAL aekikh TERM EQU 19 console device no 19 typewriter ORIG 1000 start address START OUT MSG TERM output data at address MSG HLT halt execution MSG ALF HELLO ALF WORL ALF D END START end of program General purpose fictional computer MMIX MMIXAL aekikh string BYTE Hello world a 0 string to be printed a is newline and 0 terminates the string Main GETA 255 string get the address of the string in register 255 TRAP 0 Fputs StdOut put the string pointed to by register 255 to file StdOut TRAP 0 Halt 0 end process General purpose register CISC DEC PDP 11 RT 11 MACRO 11 aekikh MCALL REGDEF TTYOUT EXIT REGDEF HELLO MOV MSG R1 MOVB R1 R0 LOOP TTYOUT MOVB R1 R0 BNE LOOP EXIT MSG ASCIZ HELLO WORLD END HELLO CISC on advanced multiprocessing OS DEC VAX VMS MACRO 32 aekikh title hello psect data wrt noexe chan blkw 1 iosb blkq 1 term ascid SYS OUTPUT msg ascii Hello world len msg psect code nowrt exe entry hello m lt gt Establish a channel for terminal I O assign s devnam term chan chan blbc r0 end Queue the I O request qiow s chan chan func io writevblk iosb iosb p1 msg p2 len Check the status and the IOSB status blbc r0 end movzwl iosb r0 Return to operating system end ret end hello RISC processor ARM RISC OS BBC BASIC s in line assembler aekikh program ADR R0 message SWI OS Write0 SWI OS Exit message DCS Hello world DCB 0 ALIGN hruxewxrchnyx cak qUE SWI OS WriteS EQUS Hello world EQUB0 ALIGN MOVPC R14 AutoHotkey aekikh MsgBox Hello World Autoit aekikh MsgBox 1 Hello world AWK aekikh BEGIN print Hello world Bash aekikh echo Hello world BASIC aekikh General aekikh The following example works for any ANSI ISO compliant BASIC implementation as well as most implementations built into or distributed with microcomputers in the 1970s and 1980s usually some variant of Microsoft BASIC 10 PRINT Hello world 20 END Such implementations of BASIC could also execute instructions in an immediate mode when line numbers are omitted The following examples work without requiring a RUN instruction PRINT Hello world Hello world Later implementations of BASIC allowed greater support for structured programming and did not require line numbers for source code The following example works when RUN for the vast majority of modern BASICs PRINT Hello world END Again the END statement is optional in many BASICs PBASIC aekikh DEBUG Hello world CR or the typical microcontroller Hello World program equivalent with the only output device present being a light emitting diode LED in this case attached to the seventh output pin DO HIGH 7 Make the 7th pin go high turn the LED on PAUSE 500 Sleep for half a second LOW 7 Make the 7th pin go low turn the LED off PAUSE 500 Sleep for half a second LOOP END StarOffice OpenOffice Basic aekikh sub main print Hello World end sub TI BASIC aekikh On TI calculators of the TI 80 through TI 86 range Disp HELLO WORLD or Output x y HELLO WORLD or Text x y HELLO WORLD or Text 1 x y HELLO WORLD only on the 83 and higher or simply HELLO WORLD On TI 89 TI 92 Voyage 200 calculators hellowld Prgm Disp Hello world EndPrgm Visual Basic aekikh Sub Main MsgBox Hello World End Sub Visual Basic NET aekikh Module HelloWorldApp Sub Main System Console WriteLine Hello world End Sub End Module or defined differently Class HelloWorldApp Shared Sub Main System Console WriteLine Hello world End Sub End Class Blitz BASIC aekikh Print Hello World DarkBASIC aekikh PRINT HELLO WORLD TEXT 0 0 Hello World WAIT KEY BCPL aekikh GET LIBHDR LET START BE WRITES Hello world N BLISS aekikh TITLE HELLO WORLD MODULE HELLO WORLD IDENT V1 0 MAIN HELLO WORLD ADDRESSING MODE EXTERNAL GENERAL BEGIN LIBRARY SYS LIBRARY STARLET EXTERNAL ROUTINE LIB PUT OUTPUT GLOBAL ROUTINE HELLO WORLD BEGIN LIB PUT OUTPUT ASCID STRING Hello World END END ELUDOM boo aekikh See also GUI Section print Hello world Casio FX 9750 aekikh This program will work on the fx 9750 graphing calculator and compatibles HELLO WORLD C aekikh include lt stdio h gt int main printf Hello world return 0 Ch aekikh The above C code can run in Ch as examples The simple one in Ch is printf Hello world n C aekikh See also GUI Section class HelloWorldApp static void Main System Console WriteLine Hello world C aekikh include lt iostream gt using namespace std int main cout lt lt Hello world n C CLI aekikh int main System Console WriteLine Hello world C Managed NET aekikh using lt mscorlib dll gt using namespace System int wmain Console WriteLine Hello world ColdFusion CFM aekikh lt cfoutput gt Hello world lt cfoutput gt COMAL aekikh PRINT Hello World CIL aekikh method public static void Main cil managed entrypoint maxstack 8 ldstr Hello world call void mscorlib System Console WriteLine string ret Clean aekikh module hello Start Hello world CLIST aekikh PROC 0 WRITE Hello World Clipper aekikh 1 1 say Hello World COBOL aekikh IDENTIFICATION DIVISION PROGRAM ID HELLO WORLD ENVIRONMENT DIVISION DATA DIVISION PROCEDURE DIVISION DISPLAY Hello world STOP RUN D aekikh import std stdio void main writefln Hello world DC an arbitrary precision calculator aekikh Hello world p DCL batch aekikh write sys output Hello world DOLL aekikh The program is itself an object The program this object can be overloaded as a function that work as main function in a C program this system stdout Hello World Dylan aekikh module hello format out Hello world n Ed and Ex Ed extended aekikh a hello world p Eiffel aekikh class HELLO WORLD creation make feature make is local io BASIC IO do io io put string N Hello world end make end class HELLO WORLD Erlang aekikh module hello export hello world 0 hello world gt io fwrite Hello world n Euphoria aekikh puts 1 Hello world F aekikh print endline Hello world Factor aekikh Hello world print filePro aekikh once mesgbox Hello world exit Fjolnir aekikh hello lt main main gt stef stofn skrifastreng Hallo Verold stofnlok GRUNNUR FOCAL aekikh type Hello World or t Hello World Focus aekikh TYPE Hello World Forte TOOL aekikh begin TOOL HelloWorld includes Framework HAS PROPERTY IsLibrary FALSE forward Hello START CLASS DEFINITIONS class Hello inherits from Framework Object has public method Init has property shared allow off override on transactional allow off override on monitored allow off override on distributed allow off override on end class END CLASS DEFINITIONS START METHOD DEFINITIONS method Hello Init begin super Init task Part LogMgr PutLine HelloWorld end method END METHOD DEFINITIONS HAS PROPERTY CompatibilityLevel 0 ProjectType APPLICATION Restricted FALSE MultiThreaded TRUE Internal FALSE LibraryName hellowor StartingMethod class Hello method Init end HelloWorld Forth aekikh halloforth Hello world CR FORTRAN aekikh PROGRAM HELLO PRINT Hello world END Fril aekikh pp Hello world Frink aekikh println Hello world Gambas aekikh See also GUI section PUBLIC SUB Main Print Hello world END Game Maker aekikh In the draw event of some object draw text x y Hello World Or to show a splash screen message show message Hello World Haskell aekikh module Main main where main putStrLn Hello World or main putStrLn Hello World Heron aekikh program HelloWorld functions main print string Hello world end HP 41 amp HP 42S aekikh Handheld Hewlett Packard RPN based alphanumeric engineering calculators 01 LBLTHELLO 02 THELLO WORLD 03 PROMPT HyperTalk Apple HyperCard s scripting programming language aekikh put Hello world orAnswer Hello World IDL aekikh print Hello world Inform aekikh Main print Hello world Io aekikh Hello world print or write Hello world n Iptscrae aekikh ON ENTER Hello World amp SAY J aekikh Simplest Hello World Probably closest in semantics Hello World Jal aekikh include 16f877 20 include hd447804 hd44780 clear hd44780 H hd44780 e hd44780 l hd44780 l hd44780 o hd44780 hd44780 W hd44780 o hd44780 r hd44780 l hd44780 d hd44780 Java aekikh See also GUI section public class Work name or tag public static void main String args System out println Hello world Java byte code aekikh disassembler output of javap c Hello class public class Hello extends java lang Object public Hello public static void main java lang String Method Hello 0 aload 0 1 invokespecial 1 lt Method java lang Object gt 4 return Method void main java lang String 0 getstatic 2 lt Field java io PrintStream out gt 3 ldc 3 lt String Hello world gt 5 invokevirtual 4 lt Method void println java lang String gt 8 return K aekikh 0 Hello world n Kogut aekikh WriteLine Hello world Lisp aekikh Lisp has many dialects that have appeared over its almost fifty year history Common Lisp aekikh format t Hello world or write line Hello World or merely Hello World Scheme aekikh display Hello world newline Emacs Lisp aekikh print Hello World Logo aekikh print hello world or pr Hello World In mswlogo only messagebox Hi Hello World Lua aekikh print Hello world LuaPSP aekikh screen print 1 1 Hello world screen flip M MUMPS aekikh W Hello world Macsyma Maxima aekikh print Hello world Maple aekikh print Hello World Mathematica aekikh Print Hello World MATLAB aekikh disp Hello World Max aekikh max v2 N vpatcher 10 59 610 459 P message 33 93 63 196617 Hello world P newex 33 73 45 196617 loadbang P newex 33 111 31 196617 print P connect 1 0 2 0 P connect 2 0 0 0 P pop Modula 2 aekikh MODULE Hello FROM Terminal2 IMPORT WriteLn WriteString BEGIN WriteString Hello world WriteLn END Hello MOO aekikh notify player Hello world MS DOS batch aekikh with the standard command com interpreter The symbol is optional and prevents the system from repeating the command before executing it The symbol must be omitted on versions of MS DOS prior to 3 0 echo Hello world MUF aekikh main me Hello world notify Natural aekikh WRITE Hello World END Nemerle aekikh The easiest way to get Nemerle print Hello world would be that System Console WriteLine Hello world however in bigger applications the following code would be probably more useful using System Console module HelloWorld Main void WriteLine Hello world Oberon aekikh Oberon is both the name of a programming language and an operating system Program written for the Oberon operating system MODULE Hello IMPORT Oberon Texts VAR W Texts Writer PROCEDURE World BEGIN Texts WriteString W Hello World Texts WriteLn W Texts Append Oberon Log W buf END World BEGIN Texts OpenWriter W END Hello Freestanding Oberon program using the standard Oakwood library MODULE Hello IMPORT Out BEGIN Out String Hello World Out Ln END Hello Objective C aekikh Functional C Version aekikh import lt stdio h gt int main printf Hello World n return 0 Object Oriented C Version aekikh import lt stdio h gt An object oriented version interface Hello Object const char str Hello world id hello void end implementation Hello id hello void printf s n str end int main void Hello h Hello new h hello h free return 0 OPENSTEP Cocoa Version aekikh import lt Foundation Foundation h gt int main int argc const char argv NSLog Hello World return 0 OCaml aekikh print endline Hello world OPL aekikh See also GUI section PROC hello PRINT Hello World ENDP OPS5 aekikh object class request action startup strategy MEA make request action hello rule hello request action hello write Hello World crlf OPS83 aekikh module hello main procedure main write Hello world n Parrot assembly language aekikh print Hello world n end Pascal aekikh program hello output begin writeln Hello world end Perl aekikh print Hello world n This is the first example in Learning Perl the semicolon is optional Perl 6 aekikh say Hello World PHP aekikh Hello world or lt php echo Hello world n gt or lt Hello world n gt Note This will not work unless short open tags are enabled Pike aekikh int main write Hello world n return 0 PL SQL aekikh start anonymous block set serveroutput on size 10000000 begin dbms output enable 1000000 dbms output put line Hello World end end anonymous block PL I aekikh Test proc options main reorder put skip edit Hello world a end Test POP 11 aekikh Hello world gt PostScript aekikh See PDL section Processing aekikh println Hello world Prolog aekikh write Hello world nl Python aekikh print Hello world hruxin Python 3 x print Hello world REFAL aekikh ENTRY GO lt Prout Hello world gt REXX ARexx NetRexx and Object REXX aekikh say Hello world RPL aekikh See also GUI section On Hewlett Packard HP 28 HP 48 and HP 49 series graphing calculators lt lt CLLCD Hello world 1 DISP 0 WAIT DROP gt gt Ruby aekikh See also GUI section puts Hello world SAS aekikh data null put Hello world run Sather aekikh class HELLO WORLD is main is OUT Hello world n end end Scala programming language aekikh object HelloWorld with Application Console println Hello world Scriptol aekikh print Hello world sed aekikh note requires at least one line of input sed ne 1s Hello world p Seed7 aekikh include seed7 05 s7i const proc main is func begin writeln Hello world end func Self aekikh Hello World print Simula aekikh BEGIN OutText Hello world OutImage END Smalltalk aekikh Transcript show Hello world cr SML aekikh print Hello world n SNOBOL aekikh OUTPUT Hello world END Span aekikh class Hello static public main args Console lt lt Hello world n SPARK aekikh with Spark IO inherit Spark IO main program procedure Hello World global in out Spark IO Outputs derives Spark IO Outputs from Spark IO Outputs is begin Spark IO Put Line Spark IO Standard Output Hello world 0 end Hello World SPITBOL aekikh OUTPUT Hello world END SQL aekikh CREATE TABLE message text char 15 INSERT INTO message text VALUES Hello world SELECT text FROM message DROP TABLE message or e g Oracle dialect SELECT Hello world FROM dual or for Oracle s PL SQL proprietary procedural language BEGIN DBMS OUTPUT ENABLE 1000000 DBMS OUTPUT PUT LINE Hello World from PL SQL END or e g MySQL or PostgreSQL dialect SELECT Hello world or e g T SQL dialect PRINT Hello world or for KB SQL dialect select Null from DATA DICTIONARY SQL QUERY FOOTER or HEADER or DETAIL or FINAL event write Hello world STARLET aekikh RACINE HELLO WORLD NOTIONS HELLO WORLD ecrire Hello world TACL aekikh OUTPUT Hello world Tcl Tool command language aekikh See also GUI section puts Hello world Turing aekikh put Hello world TSQL aekikh Declare Output varchar 16 Set Output Hello world Select Output or simpler variations Select Hello world Print Hello world UNIX style shell aekikh echo Hello world or printf s Hello world n or for a curses interface dialog msgbox Hello world 0 0 Visual Prolog console program aekikh include pfc console console ph goal console init stdio write Hello World Graphical user interfaces GUIs aekikhActionScript Macromedia flash mx aekikh this createTextField hello txt 0 10 10 100 20 this hello txt text Hello world AppleScript aekikh See also TUI section display dialog Hello World buttons OK default button 1 Or to have the OS synthesize it and literally speak out the words hello world with no comma as that would cause the synthesizer to pause say Hello world boo aekikh See also TUI section import System Drawing import System Windows Forms f Form f Controls Add Label Text Hello World Location Point 40 30 f Controls Add Button Text Ok Location Point 50 55 Click Application Exit Application Run f Functional equivalent of C program below C aekikh See also TUI section using System using System Drawing using System Windows Forms class HelloWorldForm Form public static void Main Application Run new HelloWorldForm public HelloWorldForm Label label new Label label Text Hello World label Location new Point 40 30 Controls Add label Button button new Button button Text OK button Location new Point 50 55 Controls Add button button Click new EventHandler OnButtonOk void OnButtonOk Object sender EventArgs e Application Exit or using System using System Drawing using System Windows Forms namespace HelloWorld public class HelloWorld Form public HelloWorld ShowMessage STAThread static void Main Application Run new HelloWorld private void ShowMessage MessageBox Show Hello World Hello World C MessageBoxButtons OK MessageBoxIcon Information MessageBoxDefaultButton Button1 Cocoa or GNUStep In Objective C aekikh import lt Cocoa Cocoa h gt interface hello NSObject end implementation hello void awakeFromNib NSBeep we don t need this but it s conventional to beep when you show an alert NSRunAlertPanel Message from your Computer Hello world Hi nil nil end Curl aekikh curl 3 0 4 0 applet curl file attributes character encoding utf 8 Hello world Delphi Kylix aekikh program Hello World uses Windows begin ShowMessage Hello world end Euphoria aekikh MS Windows only basic include msgbox e if message box Hello world Hello 0 then end if MS Windows only using Win32Lib library include win32lib ew createForm Window Hello Label Hello World include w32start ew FLTK2 in C aekikh include lt fltk Window h gt include lt fltk Widget h gt include lt fltk run h gt using namespace fltk int main int argc char argv Window window new Window 300 180 window gt begin Widget box new Widget 20 40 260 100 Hello World box gt box UP BOX box gt labelfont HELVETICA BOLD ITALIC box gt labelsize 36 box gt labeltype SHADOW LABEL window gt end window gt show argc argv return run Gambas aekikh See also TUI section PUBLIC SUB Main Message Info Hello world END GTK in C aekikh include lt iostream gt include lt gtkmm main h gt include lt gtkmm button h gt include lt gtkmm window h gt using namespace std class HelloWorld public Gtk Window public HelloWorld virtual HelloWorld protected Gtk Button m button virtual void on button clicked HelloWorld HelloWorld m button Hello world set border width 10 m button signal clicked connect SigC slot this amp HelloWorld on button clicked add m button m button show HelloWorld HelloWorld void HelloWorld on button clicked cout lt lt Hello world lt lt endl int main int argc char argv Gtk Main kit argc argv HelloWorld helloworld Gtk Main run helloworld return 0 GTK in Python aekikh from gtk import window Window WINDOW TOPLEVEL window set title Hello World window connect destroy main quit window add VBox window child pack start Label Hello World button Button OK window child pack end button button connect clicked main quit window show all main or import gtk gtk MessageDialog message format Hello World run Gtk in C aekikh using Gtk using GtkSharp using System class Hello static void Main Application Init Window window new Window window DeleteEvent cls evn Button close new Button Hello World close Clicked new EventHandler cls evn window Add close window ShowAll Application Run static void cls evn object obj EventArgs args Application Quit GTK 2 x in Euphoria aekikh include gtk2 wrapper e Info NULL Hello Hello World Java aekikh See also TUI section import javax swing JOptionPane public class Hello public static void main String args JOptionPane showMessageDialog null Hello world Java applet aekikh Java applets work in conjunction with HTML files lt HTML gt lt HEAD gt lt TITLE gt Hello World lt TITLE gt lt HEAD gt lt BODY gt HelloWorld Program says lt APPLET CODE HelloWorld class WIDTH 600 HEIGHT 100 gt lt APPLET gt lt BODY gt lt HTML gt import import public class HelloWorld extends Applet public void paint Graphics g g drawString Hello world 100 50 JavaScript and JScript aekikh JavaScript an implementation of ECMAScript is a client side scripting language used in HTML files The following code can be placed in any HTML file alert Hello world gt lt script gt lt a href onclick helloWorld return false gt Hello World Example lt a gt An easier method uses JavaScript implicitly directly calling the reserved alert function Cut and paste the following line inside the lt body gt lt body gt HTML tags lt a href onclick alert Hello world return false gt Hello World Example lt a gt An even easier method involves using popular browsers support for the virtual javascript protocol to execute JavaScript code Enter the following as an Internet address usually by pasting into the address box javascript alert Hello world There are many other ways javascript document write Hello world n K aekikh This creates a window labeled Hello world with a button labeled Hello world hello hello l Hello world hello c button show hello OPL aekikh See also TUI section On Psion Series 3 and later compatible PDAs PROC guihello ALERT Hello world Exit ENDP or PROC hello dINIT Window Title dTEXT Hello World dBUTTONS OK 13 DIALOG ENDP Qt toolkit in C aekikh include lt qapplication h gt include lt qpushbutton h gt include lt qwidget h gt include lt iostream gt class HelloWorld public QWidget Q OBJECT public HelloWorld virtual HelloWorld public slots void handleButtonClicked QPushButton mPushButton HelloWorld HelloWorld QWidget mPushButton new QPushButton Hello World this connect mPushButton SIGNAL clicked this SLOT handleButtonClicked HelloWorld HelloWorld void HelloWorld handleButtonClicked std cout lt lt Hello World lt lt std endl int main int argc char argv QApplication app argc argv HelloWorld helloWorld app setMainWidget amp helloWorld helloWorld show return app exec or include lt QApplication gt include lt QPushButton gt int main int argc char argv QApplication app argc argv QPushButton hello Hello world hello resize 100 30 hello show hello connect amp hello SIGNAL clicked SLOT close return app exec REAL aekikh RPL aekikh See also TUI section On Hewlett Packard RTML aekikh Hello TEXT Hello world Ruby with WxWidgets aekikh See also TUI section require wxruby class HelloWorldApp lt Wx App def on init ourFrame Wx Frame new nil 1 Hello world show ourDialogBox Wx MessageDialog new ourFrame Hello world Information Wx OK Wx ICON INFORMATION show modal end end HelloWorldApp new main loop Ruby with GTK aekikh See also TUI section require gtk2 Gtk init window Gtk Window new window signal connect delete event Gtk main quit false button Gtk Button new Hello World button signal connect clicked Gtk main quit false window add button window show all Gtk main SWT in Java aekikh import org eclipse swt SWT import org eclipse swt layout RowLayout import org eclipse swt widgets Shell import org eclipse swt widgets Label public class SWTHello public static void main String args Display display new Display final Shell shell new Shell display RowLayout layout new RowLayout layout justify true layout pack true shell setLayout layout Tcl Tk aekikh See also TUI section label l text Hello world pack l Python with Tkinter aekikh See also TUI section import Tkinter r Tkinter Tk w Tkinter Label r text Hello world w pack r mainloop or more primitively import Visual Basic including VBA aekikh Sub Main MsgBox Hello world End Sub Visual Prolog note box aekikh include pfc vpi vpi ph goal vpiCommonDialogs note Hello World Windows API in C aekikh This uses the Windows API to create a full window containing the text Another example below uses the built in MessageBox function instead include lt windows h gt LRESULT CALLBACK WindowProcedure HWND UINT WPARAM LPARAM char szClassName MainWnd int WINAPI WinMain HINSTANCE hInstance HINSTANCE hPrevInstance LPSTR lpCmdLine int nCmdShow HWND hwnd MSG msg WNDCLASSEX wincl wincl cbSize sizeof WNDCLASSEX wincl cbClsExtra 0 wincl cbWndExtra 0 wincl style 0 wincl hInstance hInstance wincl lpszClassName szClassName wincl lpszMenuName NULL No menu wincl lpfnWndProc WindowProcedure wincl hbrBackground HBRUSH COLOR WINDOW 1 Color of the window wincl hIcon LoadIcon NULL IDI APPLICATION EXE icon wincl hIconSm LoadIcon NULL IDI APPLICATION Small program icon wincl hCursor LoadCursor NULL IDC ARROW Cursor if RegisterClassEx amp wincl return 0 hwnd CreateWindowEx 0 No extended window styles szClassName Class name Window caption WS OVERLAPPEDWINDOW amp WS MAXIMIZEBOX CW USEDEFAULT CW USEDEFAULT Let Windows decide the left and top positions of the window 120 50 Width and height of the window NULL NULL hInstance NULL Make the window visible on the screen ShowWindow hwnd nCmdShow Run the message loop while GetMessage amp msg NULL 0 0 gt 0 TranslateMessage amp msg DispatchMessage amp msg return msg wParam LRESULT CALLBACK WindowProcedure HWND hwnd UINT message WPARAM wParam LPARAM lParam PAINTSTRUCT ps HDC hdc switch message case WM PAINT hdc BeginPaint hwnd amp ps TextOut hdc 15 3 Hello world 13 EndPaint hwnd amp ps break case WM DESTROY PostQuitMessage 0 break default return DefWindowProc hwnd message wParam lParam return 0 Or much more simply include lt windows h gt int WINAPI WinMain HINSTANCE hInst HINSTANCE hPrevInstance LPSTR lpCmdLine int nCmdShow MessageBox NULL Hello world MB OK return 0 Windows Script Host with VBScript aekikh lt job id HelloWorld gt lt script language VBScript gt WScript Echo Hello world lt script gt lt job gt Windows Script Host with JScript aekikh lt job id HelloWorld gt lt script language JScript gt WScript Echo Hello world lt script gt lt job gt XSL T aekikh There are many ways to do this in XSL the simplest being lt xsl template match gt lt xsl text gt Hello world lt xsl text gt lt xsl template gt If nested similar to the HTML version it would be lt xsl template match gt lt html gt lt body gt lt h1 gt Hello world lt h1 gt lt body gt lt html gt lt xsl template gt XUL aekikh Type the following in a text file e g hello world xul and then open with Mozilla Firefox lt window xmlns http www mozilla org keymaster gatekeeper there is only xul gt lt box align center pack center flex 1 gt lt description gt Hello world lt description gt lt box gt lt window gt Esoteric programming languages aekikhSee Hello world program in esoteric languagesDocument formats aekikhASCII aekikh The following sequence of characters expressed in hexadecimal notation with carriage return and newline characters at end of sequence 48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21 0D 0A The following sequence of characters expressed as binary numbers with cr nl as above and the same ordering of bytes 00 07 01001000 01100101 01101100 01101100 01101111 00101100 00100000 01110111 08 0E 01101111 01110010 01101100 01100100 00100001 00001101 00001010 LaTeX 2e aekikh documentclass article begin document Hello world end document Page description languages aekikhXHTML 1 1 aekikh Using UTF 8 character set lt xml version 1 0 encoding UTF 8 gt lt DOCTYPE html PUBLIC W3C DTD XHTML 1 1 EN http www w3 org TR xhtml11 DTD xhtml11 dtd gt lt html xmlns http www w3 org 1999 xhtml xml lang en gt lt head gt lt title gt Hello world lt title gt lt head gt lt body gt lt p gt Hello world lt p gt lt body gt lt html gt HTML aekikh simple lt html gt lt body gt lt h1 gt Hello world lt h1 gt lt body gt lt html gt lt html gt and lt body gt tags are not necessary for informal testing You could even use the following lt pre gt Hello World lt pre gt or simply write it as text without tags HTML 4 01 Strict full lt DOCTYPE HTML PUBLIC W3C DTD HTML 4 01 Strict EN http www w3 org TR html4 strict dtd gt lt html gt lt head gt lt meta http equiv Content Type content text html charset ISO 8859 1 gt lt title gt Hello World lt title gt lt head gt lt body gt lt p gt Hello world lt p gt lt body gt lt html gt Notice that the HEAD tag is optional and could be omitted The first paragraph of the W3C Recommendation on The global structure of an HTML document also features this example PDF aekikh PDF 1 0 1 0 obj lt lt Type Catalog Pages 3 0 R Outlines 2 0 R gt gt endobj 2 0 obj lt lt Type Outlines Count 0 gt gt endobj 3 0 obj lt lt Type Pages Count 1 Kids 4 0 R gt gt endobj 4 0 obj lt lt Type Page Parent 3 0 R Resources lt lt Font lt lt F1 7 0 R gt gt ProcSet 6 0 R gt gt MediaBox 0 0 612 792 Contents 5 0 R gt gt endobj 5 0 obj lt lt Length 44 gt gt stream BT F1 24 Tf 100 100 Td Hello World Tj ET endstream endobj 6 0 obj PDF Text endobj 7 0 obj lt lt Type Font Subtype Type1 Name F1 BaseFont Helvetica Encoding MacRomanEncoding gt gt endobj xref 0 8 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000179 00000 n 0000000322 00000 n 0000000415 00000 n 0000000445 00000 n trailer lt lt Size 8 Root 1 0 R gt gt startxref 553 EOF PostScript aekikh Displays on console Hello world Displays as page output Courier findfont 24 scalefont setfont 100 100 moveto Hello world show showpage RTF aekikh rtf1 ansi deff0 fonttbl f0 Courier New f0 fs20 Hello world TeX aekikh Hello World byeMedia based scripting languages aekikhAviSynth aekikh BlankClip Subtitle Hello world Creates a video with default properties Lingo Macromedia Director scripting language aekikh on exitFrame me put Hello World end Outputs the string to the message window if placed in a single movie frame Alternatively to display an alert box stating the message you could use on exitFrame me alert Hello World end POV Ray aekikh include colors inc camera location lt 3 1 10 gt look at lt 3 0 0 gt light source lt 500 500 1000 gt White text ttf timrom ttf Hello world 1 0 pigment White ekhathungcak https th wikipedia org w index php title opraekrmehlolewild amp oldid 9248588, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม