∆ Advertisements |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TrueLogicSoftwares |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Home Articles Products Support Feed Back NewsLetter Site Map ABOUT US |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hello World Program in more then 50 Programming
|
Level of Difficulty | 1 2 3 4 5 |
|
Source Code for this Article | HelloWorld.zip |
If you have Programmed the Computer in any language, then you must heard about the "Hello World!" Program, this is the First Step in order to understand any Programming Language.
"Hello World" Program is first mentioned by the Developer of "C" Language by Brian Kernighan and D. Ritche, in his Golden Book "The C Programming Language", where he has been Described the "Hello World" Program in the Whole book. Which Print "hello, world" to the Screen.
Here I am Going to Define "Hello World" Program in more then 50 Languages, thinking that this will help u to Start learning new Languages or will give you the Over View to a New Language, If you get confused on a term then consult here!, or Click here to see the Index of the Programming Language.
If you want to save the Page for future use, Don't save by the browser, all the Code and this Article is included in the Zip file, Download HelloWorld.zip.
I have made all efforts to make the Codes Correct, If you see any error or have Comments, then mail me with Subject Line HELLO WORLD:.
In Order to Complete the Article, There are Some People who Help me to Complete the List. The List is So Long.
Ö Source Code : Hello.asm DATA SEGMENT
MSG DB "Hello, World!","$"
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START:
MOV AX, DATA ;INTILIZE
MOV DS, AX
MOV AH, 09H ;PRINT STRING
LEA DX, MSG
INT 21H
STOP:
MOV AX, 4C00H ;TERMINATE
INT 21H
CODE ENDS
END STARTInstructions To Run:
Assumed : Microsoft Assembler [MASM]
Open Dos Prompt, and use these Command, [Path where MASM is Installed.]
C:\>MASM Hello.asm
C:\>LINK Hello
If Successful [No Error Occurs] then Run
C:\>Hello.exeDescription:
All the Assembly Language Program have two Sections[Segment] DATA and CODE. Data Segment Defines the Variables, It can be of type
- DB [Define Byte] 1 Bytes
- DW [Define Word] 2 Bytes
- DQ 4 Bytes
- ** 8 Bytes
Look at the Program, MSG is the Name of Variable, it's type is DB, after that the initial value is given. The Code Segment Defines the Actual Code to be run. First notice the Assume keyword, which says the compiler to use this Segment as DATA and CODE, not to say that there can be more then one Data and Code Segments.
START and STOP are the Labels. Next two Statement Initialize the Data Segment, and must be used in all the Programs. Next three Statements will print the MSG Variable to the Screen. Notice the Statement INT 21H will generate Interrupt 21H, and its argument is saved in Register AH with Value 09H [in HexaDecimal format], which actually whatever is stored in Register DX i.e. Variable MSG. After STOP Label these two statements will Actually Terminate the Program, and must be used in all the program.
Ö Source Code : Hello.c
#include<stdio.h>
void main()
{
//COMMENTS
printf("Hello World!\n");
}Instructions To Run:
Assumed : Turbo C++ Compiler, Paste It in TC Editor or Open file Hello.c in the Editor, then Press F9 to Compile if there is no error then Ctrl+F9 to Run.
Description:
The First line #Include Says to Compiler that Attach this header file in Executable file, Which has the Definition for the Functions Used by our Program e.g. printf. Next statement is the Main Entry Point [main function], which start running as the Program Loads. Next the { is the Opening Symbol for the Main Function. Next we use a single line Comments, we can write any thing in this line for ourselves. Next we are calling printf function and passes the String as the argument, Notice the \n in string which cause to print special character New Line. this printf function will cause to Print the String to Screen. finally } is the closing brace for main function, which will stop the progam.
Ö Source Code : Hello.cpp #include <iostream.h>
int main()
{
//COMMENTS
cout << "Hello World!" << endl;
return 0;
}Instructions To Run:
Assumed : Turbo C++ Compiler.
Open file Hello.cpp in the Editor, then Press F9 to Compile if there is no error then Ctrl+F9 to Run.Description:
First the #include works same like it in C, i.e Cause the iostream.h file to be included in the Executable. Next we define the main function which return an Integer type Data. Next the Single line Comment [ignored by compiler]. Next the cout is the Object not the function [as in C], and << is the operator of the object cout, and pass the String, next the endl will cause same as \n in C means causes the New Line character to be print on screen. finally the cout will cause the string to be printed in the Screen. Next the Return will tell the function to pass 0 to it's Caller. You will think that who is calling the main function. It's the Operating System which call the main function as the Program Loads in the Main Memory. Next is the Closing Brace which causes the Program to Stop running.
Ö Source Code : Hello.pas program HelloWorld(output);
begin
WriteLn('Hello World!');
end.Instructions To Run:
Assumed : Turbo Pascal
Open file in the Editor, then Press F9 to Compile if there is no error then Ctrl+F9 to Run.Description:
First We Define the Program name, Next the begin and end designate the Starting and Stop point of the Program. Next the WriteLn function will cause to Print the String to the Screen. Note that all the Statement are terminated with Semicolon.
Ö Source Code : Hello.cob *****************************
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
MAIN SECTION.
* COMMENTS
DISPLAY "Hello World!".
STOP RUN.
****************************Instructions To Run:
Assumed : COBOL 80
C:\>COBOL Hello;
C:\>RUNCOB HelloDescription:
I have used MS COBOL 80, because it is simple, Traditionally COBOL Program is Most difficult to run Correctly, by newcomers. In this Version no exe will be created, you have to use RUNCOB to run your object program, however there are many compilers which generate exe file, such as MF COBOL [by Micro Focus] etc.
First there are four Division [Parts] in the COBOL program.
- IDENTIFICATION DIVISION.
- ENVIRONMENT DIVISION.
- DATA DIVISION.
- PROCEDURE DIVISION.
Each Division will contains Para and each Para will contain Statements. First line is Actually Comments,
Note the Spaces before each statements, it is not the indentation, you must provide it as is. In Each line First 3 Characters are Page number, next three character are Line Number, 7th character is special will be blank or * for Indicating Comments or - for indicating Continue last line. We Start our program from the 8th character. I don't uses any Page or line number so i place Space, If you omit Space or misplace it then you will surely get lots of Error, and the Error Message of COBOL are just like Hell.
Program-ID defines the Program name, and must be there in all the programs. Next in Procedure Division we define the Para main as Main Section, which actually contain the Statements to be run. Display statement will cause the Corresponding string to be print on Screen. Next the Stop Run will cause the Program to Terminate.
Ö Source Code : Hello.for WRITE (*,*) 'Hello world!'
ENDInstructions To Run:
Assumed : FORTRAN 77 Compiler.
C:\>FOR1 Hello;
C:\>PAS2
C:\>Link Hello,,,MATH.LIB+FORTRAN.LIB
C:\>Hello.ExeDescription:
First line is Calling function Write and print String to the Screen, the (*,*) will cause autometic formatting of the string, otherwise we have to provide our custom format. Next the End statement will cause the program to terminate.
Note the Spaces before each statements, it is not the indentation, you must provide it as is, otherwise it will cause errors.
Ö Source Code : Hello.bas 10 PRINT "Hello world!"
20 ENDInstructions To Run:
Assume : QBasic Compiler.
Open Hello.bas file in QBasic Editor, then Either Simply Press F5 or Select Menu Run > Start, to run the Program.Description:
Starting of each line these numbers are user defined Line Numbers or Labels, in Each line it should be there, and it should be in ascending order like 1,2,3,... or 10,20,30,50,... . Next the Print statement will cause the Program to print the Specified String on screen. Next the End Statement will cause the program to Terminate running.
Ö Source Code : Hello.ada with TEXT_IO;
use TEXT_IO;
procedure Hello is
pragma MAIN;
begin
PUT ("Hello World!");
end Hello;Instructions To Run:
None
Description:
None
Ö Source Code : Hello (defun hello_world ()
(print "Hello World!")
)Instructions To Run:
None
Description:
None
Ö Source Code : Hello.lf ; COMMENTS
print [Hello World!]Instructions To Run:
Assume : PC LOGO 2.0
C:\>LOGO Hello.lfDescription:
This Language Was Used to draw Complex Maps/Diagrams, for now days It is Not used because of many Advanced Drawing Editor's has arrived.
First line is Single Line Comment, Next the print statement will cause to print the Message to the Screen. Not the String is enclosed in Brackets.
Ö Source Code : Hello.prg * COMMENTS
? "Hello World!"Instructions To Run:
Assume :
In the Editor, Open Command Window, and use this command.
do hello.prgDescription:
First line is the single line Comment, Next the ? will cause the String to be print to screen.
Ö Source Code : Hello.prg * COMMENTS
? "Hello World!"Instructions To Run:
Assume : MS FoxPro 2.6
In the Editor, Open Command Window, and use this command.
do hello.prgDescription:
First line is the single line Comment, Next the ? will cause the String to be print to screen.
Ö Source Code : Hello BEGIN
FILE F(KIND=REMOTE);
EBCDIC ARRAY E[0:11];
REPLACE E BY "Hello World!";
WHILE TRUE DO
BEGIN
WRITE(F,*,E);
END;
END.Instructions To Run:
None
Description:
None
Ö Source Code : Hello 'Hello World!'
Instructions To Run:
None
Description:
None
Ö Source Code : Hello MODULE Hello EXPORTS Main;
IMPORT Stdio, Wr;
BEGIN
Wr.PutText?(Stdio.stdout, "Hello World!");
END Hello.Instructions To Run:
None
Description:
None
Ö Source Code : Hello go :-
writeln('Hello World!').Instructions To Run:
None
Description:
None
Ö Source Code : Hello ! COMMENTS;
BEGIN
OutText("Hello World!");
OutImage;
ENDInstructions To Run:
None
Description:
None
Ö Source Code : Hello output = "Hello world!"
Instructions To Run:
None
Description:
None
Ö Source Code : Hello.vbs.htm <html>
<body>
<script language="VBScript">
' Hello World in VBScript
document.write("Hello World!")
</script>
</body>
</html>Instructions To Run:
Open the Document in Internet Explorer [or any other Browser], Or Double Click this file in Explorer.
Description:
At top and Bottom, these are HTML tags, the Script Language Defines the Language. In Script Tag, First Line is the Comment line. Next is the write Method, which print the String to the Browser.
Ö Source Code : Hello.javascript.htm <html>
<body>
<script language="JavaScript" type="text/javascript">
// Hello World in JavaScript
document.write('Hello World!');
</script>
</body>
</html>Instructions To Run:
Open the Document in Internet Explorer [or any other Browser], Or Double Click this file in Explorer.
Description:
At top and Bottom, these are HTML tags, the Script Language Defines the Language. In Script Tag, First Line is the Comment line. Next is the write Method, which print the String to the Browser.
Ö Source Code : Hello.jscript.htm <html>
<body>
<script language="JScript">
// COMMENTS
document.write('Hello World!');
</script>
</body>
</html>Instructions To Run:
Open the Document in Internet Explorer [or any other Browser], Or Double Click this file in Explorer.
Description:
At top and Bottom, these are HTML tags, the Script Language Defines the Language. In Script Tag, First Line is the Comment line. Next is the write Method, which print the String to the Browser.
Ö Source Code : Hello.asp <%@ language="vbscript" %>
<html><body>
<%
Response.write "Hello World!"
%>
</body></html>Instructions To Run:
You need to Publish the file to the Web Server, or on your personal IIS Server, Simply Place it in C:\Inetpub\wwwroot Folder, then open Browser window and type http://localhost/Hello.asp at the Address bar.
Description:
ASP is Server side language, which when encountered by the Web Server causes to be internally processed by the Compiler. After processing it will generate Native HTML tags, and sanded to the client Browser.
First line says that this ASP Page will use VBScript as Language, Next are the simply HTML Tags, which will be printed same as it is. Next the <% shows the Starting of Script Section, and %> for Closing Script Section. Next we call the Write function of the Response Object, which cause to print the string in Response.
Ö Source Code : Hello.aspx response.write("Hello World!")
Instructions To Run:
None.
Description:
It is the Next Version of the ASP, and have lots of feature...
Ö Source Code : Hello.php <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
// COMMENTS : IT IS THE ACTUAL PHP SECTION
echo 'Hello world!'
?>
</body>
</html>Instructions To Run:
You have two options for running the PHP file, First using Web Server [which is PHP enabled], and the second is using Command Line.
Using Web Server, You need to Publish the file to the Web Server [php enabled], or on your personal IIS Server, Simply Place it in C:\Inetpub\wwwroot Folder, or in the Apache Server, just by Place it in the Apache Documents folder, then open Browser window and type http://localhost/Hello.php at the Address bar.
Using Command Line, It will Parse and Generate HTML Tags but you will just see tags as Text, but not in the Browser. Use this Command.
C:\>PHP-Win.exe Hello.phpDescription:
PHP is Server side language, which when encountered by the Web Server causes to be internally processed by the Compiler. After processing it will generate Native HTML tags, and sanded to the client Browser.
You can see the first 6 Lines are the HTML Codes and Sanded back as it is. PHP Compiler Start Processing whenever it find a PHP Section, which start from <?php and end at ?>, between this tag we have to place all the PHP command and statements. In this Section, First Line is the Comment line Next is the echo statement which sand the corresponding string to Client i.e. Hello World!.
Note that this PHP section have only one command, that's why we don't have placed ; after statement, if this section have many statements then we have to separate all the statements with Semi Colon [ ; ].
Ö Source Code : Hello.pl #!/usr/bin/perl
# COMMENTS
print "Hello World!\n";Instructions To Run:
If you have place this to the Web Server, then simply use your browser to run that. Otherwise you can run it as a Command Line Program.
C:\>PERL.exe Hello.plDescription:
Perl is a Famous Language for the CGI Programming, and Still used lots more for it's Text Processing Capabilities through Regular Expression.
First Line is a Special line, it start with # [which is Comment line Character], and followed by ! which means that it show the path of Perl Executable. Next is the Comment line again. Next is the print statement which causes to print corresponding String to the Standard Output. Note the \n character which is New Line character and works Same as C.
Ö Source Code : Hello.cfm <cfset helloStr = "Hello World!">
<cfoutput>#helloStr#</cfoutput>Instructions To Run:
None
Description:
None
Ö Source Code : Hello.dir [Binary File] on startmovie
alert "Hello World!"
endInstructions To Run:
None
Description:
Lingo is the Scripting Language for the Popular Multimedia authoring tool Macromedia Director, It have lot's of capabilities.
Ö Source Code : Hello.fla [Binary file] trace('Hello World!');
Instructions To Run:
Open Flash Editor, Create a new Blank Movie , then choose Window > Panels > Actions. A Editor Window opens switch it to Expert Mode then Write this Statement in the Editor. After that Press Ctrl+Enter To run the Movie.
Description:
ActionScript is the Scripting Language for the Popular Web Multimedia authoring tool Macromedia Flash, It Provide basic features for programming Flash Objects.
Ö Source Code : Hello \documentclass{article}
\begin{document}
Hello world!
\end{document}Instructions To Run:
None
Description:
Its a Document Formatting Language.
Ö Source Code : Hello.wsh WScript.StdOut.WriteLine "Hello World!";
Instructions To Run:
Just Save the file, with Extension .wsh and Double Click File at Window Explorer to Run the Script.
Description:
Window Script Host is a Scripting Language for the Internal Windows Operations, Like If you want to Change the Format Window Explorer, Then you need to Program it with WSH.
This Code Snippet will Print the Specified String. I don't have much information about it. Hope you Provide, if u know more about it?
Ö Source Code : Hello.vb6.bas Sub Main()
MessageBox("Hello World!")
End SubInstructions To Run:
Start Visual Basic Editor, Open this file Hello.vb6.bas, Default Project will be Created for you, then just press Function Key F5, if an error appear, then Set the Startup Object to Sub Main() on the Appeared Dialog box, again Press F5, this will be run.
Description:
This is the most famous and widely used programming language for Windows, with the programmers base of approx 4 Millions.
This Code will not display a Message Box [Alert] , and Just Stop. The first line is the Definition of a Subroutine [procedure], which is named main. VB Compiler is designed to Start Running at Main subroutine. Next We are calling a function named MessageBox with a argument hello world, This function will display a Model dialog window, with the text we provided. Next the End Sub says that the Subroutine ends, and the Program will Terminate.
Ö Source Code : Hello.vb Class HelloWorld
Shared Sub Main()
System.Console.WriteLine("Hello world!")
End Sub
End ClassInstructions To Run:
Open this file in Visual Studio .net Editor, Create Default Solution, then click run button.
Description:
VB.net is the next edition of the VB6.0, and have lots of features,
- Being Object Oriented.
- Remove the need of Dependency. [the feature which i like Most, Otherwise most of the developers will drop advance features because it makes huge dependency]
- Move to the .net Framework.
- Etc.
First of all, Note the Class HelloWorld, means that it will create a new Class. Next the Main function. in main function we are calling WriteLine function of object console, which is the member of System Object. The WriteLine function will print the String to the Screen.
Ö Source Code : Hello.vc6.cpp #include <windows.h>
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Hello world!", "", MB_OK);
return 0;
}Instructions To Run:
Open MS Visual C++ 6.0 Editor.
Open Hello.vc6.cpp file, then Click Execute button, this will ask you to create default workspace, say yes.Description:
Microsoft Visual C++ 6.0 is the Most Widely used Development Environment for Serious Windows Application Development.
This Application will just show a Message Box saying Hello World!. WinMain is the Default function for windows application, as main in C. in the Function We are just calling Window32API function MessageBox to display Alert Box.
Ö Source Code : Hello.cs // COMMENTS
using System;
class HelloWorld
{
public static int Main(String[] args)
{
Console.WriteLine("Hello World!");
return 0;
}
}Instructions To Run:
Assumed : Microsoft .net Framework is installed
Open Dos Prompt, and move to folder where .net is installed, then use these commands.
C:\>CSC Hello.cs
If no error occurs then run
C:\>Hello.ExeDescription:
C# [C Sharp] is a modern language by Microsoft, which is support Full OOPs and Syntax is near to JAVA.
First Line is single line Comment, Next is the Declaration that this program use the system library. Note the ;[Semicolon], Each statement must be Separated by the Semicolon in C#. and note that we use { Opening Brace and } Closing Brace for Opening and Closing Sections like in C. Next we Define a Class named HelloWorld. Next is the Main function [which will automatically run as the program loads]. note the public static before main, it must be there because main function is defined insight the class, which means that it can't be called from outside until it is not declared as public member of the class. Next is the WriteLn function which print the specified string on screen, note that the WriteLn function is the member of Console Object. return 0 means that this program tells the OS[the Caller of the Program] that the program is successfully runs.
If you cleanly observe that the JAVA and C# Code snippet is quite similar, Why This? Sorry I can't say, it's the matter of Big Bulls ;-)
Ö Source Code : Hello.java // COMMENTS
class HelloWorld
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}Instructions To Run:
Assumed : Sun JAVA 2 [J2EE]
Open Dos Prompt, and move to folder where JAVA is installed, then use these commands.
C:\>JAVAC Hello.java
If no error occurs then run,
C:\>JAVA HelloDescription:
JAVA is So Popular language, and used widely for developing Cross Platform Application[ such as mobile Apps]. Instead of generating an Executable, the Compiler will generate a CLASS file, which can be run through JAVA.EXE [JVM]. You may think that it has Profit+Loss both. LOSS: It is a Slow Process, so that most Big Applications will not prefer java, because lack of speed. PROFIT: You can run Single Application on many Platform like [window, Linux, mobiles, PDA].
First Line is single line Comment, Note the ;[Semicolon], Each statement must be Separated by the Semicolon in JAVA. and note that we use { Opening Brace and } Closing Brace for Opening and Closing Sections like in C. Next we Define a Class named HelloWorld. Next is the Main function [which will automatically run as the program loads]. note the public static before main, it must be there because main function is defined insight the class, which means that it can't be called from outside until it is not declared as public member of the class. Next is the println function which is the member of the Out Object which is also the member of System Object, this function will print the specified string to Screen.
If you cleanly observe that the JAVA and C# Code snippet is quite similar, Why This? Sorry I can't say, it's the matter of Big Bulls ;-)
Ö Source Code : Hello Will Be Added Soon.
Instructions To Run:
None
Description:
It's the Major competer in the field of Window Application, and Gaining Rapidly the market. I have impressed with the Speed and the Ease of the Application Developed in the PowerBuilder.
Ö Source Code : Hello Program HelloWorld;
{$APPTYPE CONSOLE}
//COMMENTS
Begin
WriteLn('Hello World!');
End.Instructions To Run:
Open the file in the Editor, Then Goto menu and Run.
Description:
Delphi is in the market from the vary old days, It uses PASCAL for programming for windows.
The First line is the Program name. Next is the Compiler Derivative, that this prorgam is a Dos Program. Next line is the Single line Comment. Next the Begin and End works same like { } works in C, for Opening and Closing Sections. WriteLn is a Pascal like statement for Printing String to Screen.
Ö Source Code : Hello.py # COMMENTS
print "Hello World!"Instructions To Run:
Assume : Any Version of Python Compiler.
Open the Dos Prompt, and Move to the folder where python is installed, use these command.
C:\>PYTHON Hello.pyDescription:
Python is the Open Source Language, and Gaining attraction!, It is Claimed to be most Readable language, it is both Interpreted and Compiled, and can be used for developing console and window applications.
First line is the Single line Comment. Next is the Print statement which print the specified string to the screen.
Ö Source Code : Hello #!/usr/local/bin/tclsh
# COMMENTS
puts "Hello World!"Instructions To Run:
None.
Description:
First line is the Special Comment line which says where the tcl compiler is located, as in perl. Next is the Single line Comment. Next is the Puts statements which print the specified string on screen.
Ö Source Code : Hello.vfoxpro.prg * COMMENTS
? "Hello World!"Instructions To Run:
Open the Visual FoxPro Editor, then in Command Window, use this Command.
do Hello.vfoxpro.prgDescription:
This Program has nothing special than FoxPro, Check FoxPro for Description.
Ö Source Code : Hello Will Be Added Soon.
Instructions To Run:
None.
Description:
None.
Ö Source Code : Hello.plsql.txt -- COMMTNTS
set serveroutput on
begin
dbms_output.enable(10000);
dbms_output.put_line('Hello World!');
end;Instructions To Run:
None.
Description:
PL/SQL the programming language for the Database, as the SQL is the Database Query language, PL/SQL is the language for programming database triggers etc.
Ö Source Code : Hello.sql SELECT 'Hello World!' FROM dual;
Instructions To Run:
Open Oracle SQL Plus, and use the Source Code as Command.
Description:
SQL is the Database Query language, and will be supplied with all major Database Softwares, for Querying the Database.
Ö Source Code : Hello.abap4.txt REPORT ZHB00001.
*Hello world in ABAP/4 *
WRITE: 'Hello world!'.Instructions To Run:
None.
Description:
ABAP4 is the language for Developing ERP Programs for the SAP.
First line is the Compiler Derivative. Next is the Comment. Next the Write Statement will display the specified string.
Ö Source Code : Hello.rb puts "Hello world!"
Instructions To Run:
Assume the Ruby is installed. use this command.
C:\>ruby hello.rbDescription:
This puts statement will print the Specified string on screen.
Ö Source Code : Hello.htm <HTML>
<!-- COMMENTS -->
<HEAD>
<TITLE>Hello World!</TITLE>
</HEAD>
<BODY>
Hello World!
</BODY>
</HTML>Instructions To Run:
Double Click the Hello.htm file in Explorer, it will open on the Default Browser [like Internet Explorer].
Description:
HTML is the Universal Document Formatting language, and used widely on the Internet [Standard is maintained by http://www.w3c.org Organization]. It works on Tags, as if i want to display a World Bold in "Hello World" text then i have to Place Hello <b>World.</b>, the result is below.
Hello World.
Note that all the Tags are enclosed in opening and closing angle bracket <>.and if the Starting tag is <b> then it's end tag will be </b>
First the HTML Tag defined the HTML Document Starts. Next is the Comment line. Then the HTML document is divided in two sections HEAD [defines the header of the document] and BODY [defines the actual document]. Next in the HEAD section title tag defines the Title of the Document [i.e. displayed in the the title bar of the browser]. Next in the Body we define actual Text to display as in this case Hello World!.
Ö Source Code : Hello.xml <?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="Hello-World.xsl" ?>
<!-- COMMENTS -->
<text><string>Hello World!</string></text>Instructions To Run:
Double Click the Hello.xml file in Explorer, it will open on the Default Browser [like Internet Explorer].
Description:
XML is the Data Formatting Language, Suppose many organization wants to share same data, then you probably make a Text file with the format you suits, and each of the organization will write program to translate your data according to them. This is obvious the time wastage, Here the XML comes and solve the Problem!
It also works on tags, like HTML but here we define Tags according to our needs, and place the defination of tags on XSL file.
Ö Source Code : Hello.xslt <?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Hello World in XSLT -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="text/string" />
</xsl:template>
</xsl:stylesheet>Instructions To Run:
None.
Description:
None.
Ö Source Code : hello.sh # COMMENTS : RUN WITH [sh, ksh,bash]
echo 'Hello World!'Instructions To Run:
Assume : Linux or Unix System.
This Script Can be run on Unix or Linux System, use this Command.
$sh hello.shDescription:
First line is the Comment. Next the echo statement will print the specified string to the screen.
Ö Source Code : hello.bat @echo off
rem COMMENTS
echo Hello World!Instructions To Run:
C:\>Hello.bat
or
C:\>HelloDescription:
As you see the Shell script for Unix, Window users can also use Batch file. You don't need anything other then Window or Dos.
First line says the Interpreter, not to show Commands but only the output. Next is the Single line Comment. Next the Echo command will display the specified string on screen.
If you look on your File System's Command or System32 Folder, you will find that the echo.exe is there, so what commands you use on dos command prompt, that may be used in the bat file. If you think it is Simple then Consider this Example.
This is the Code, that i use for Compiling, Linking and Running and even Creating New file for my Assembly Language [MASM] Files. Otherwise i need to provide lost of command to create a single Program. here i use commands
Ö Source Code : ASM.bat ECHO OFF
CLS
IF "%1" == "" GOTO BYE
IF NOT EXIST .\%1.ASM GOTO SERR
IF "%2" == "E" GOTO EDITIT
DEL %1.OBJ
DEL %1.EXE
CLS
ECHO ²Û²Û²Û²Û²Û²Û²Û²Û²Û² COMPILING...MASM Û²Û²Û²Û²Û²Û²Û²Û²Û
MASM/T %1; > LOG
MORE LOG
IF NOT EXIST .\%1.OBJ GOTO CERR
PAUSE
CLS
ECHO Û²Û²Û²Û²Û²Û²Û²Û²Û² LINKING...LINK Û²Û²Û²Û²Û²Û²Û²Û²Û²Û
LINK %1;
IF NOT EXIST .\%1.EXE GOTO LERR
PAUSE
CLS
ECHO Û²Û²Û²Û²Û²Û²Û²² RUNNING...%1.EXE Û²Û²Û²Û²Û²Û²Û²Û
%1.EXE
GOTO BYE
:SERR
ECHO %1.ASM
ECHO Û²Û²Û²Û²Û²Û²Û²Û²Û²Û² ERROR FOUND Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²
ECHO ² Û
ECHO Û * SOURCE FILE NOT FOUND IN CURRENT DIRECTORY ²
ECHO ² * GOING TO CREATE NEW ONE FROM TAMPLATE Û
ECHO Û CTRL+C TO CANCEL ²
ECHO Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û
PAUSE
COPY .\TAMPLATE.ASM .\%1.ASM
EDIT %1.ASM
GOTO BYE
:CERR
ECHO .
ECHO Û²Û²Û²Û²Û²Û²Û²Û²Û²Û² ERROR FOUND Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²
ECHO ² Û
ECHO Û * ERROR FOUND IN COMPILE TIME ²
ECHO ² * SENDING U IN EDIT MODE Û
ECHO Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²²
PAUSE
EDIT LOG %1.ASM
GOTO BYE
:LERR
ECHO .
ECHO Û²Û²Û²Û²Û²Û²Û²Û²Û²Û² ERROR FOUND Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²
ECHO ² Û
ECHO Û * ERROR FOUND IN LINKING TIME ²
ECHO ² * SENDING U IN EDIT MODE Û
ECHO Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²Û²²
PAUSE
EDIT LOG %1.ASM
:EDITIT
EDIT %1.ASM
GOTO BYE
:BYE
ECHO ONC:\MASM\>ASM NEWFILE
For creating new file named NEWFILE.ASM based on the Template file.
C:\MASM\>ASM File1
To Compile file file1.asm, if error then open file1.asm and ErrorLog for Edit, If no error then Link, If Error then display Error Massage, otherwise Run the Executable.
Ö Source Code : hello.inf ; COMMENTS : Hello World from INF
; THIS WILL COPY README.TXT, HELLO.INF TO WINDOWS\HELLO FOLDER
; GOTO ADD REMOVE PROGRAMS, SEE HELLO WORLD ENTERY
; UNINSTALL IT.
[version]
signature="$CHICAGO$"
; #### INSTALLER ####
[DefaultInstall]
CopyFiles=install.files
AddReg=add-registry-section
[DestinationDirs]
install.files=10,"Hello"
Delete.files=10,"Hello"
[install.files]
ReadMe.txt
hello.inf
[add-registry-section]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Hello",,,
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Hello", "DisplayName",0,"Hello World"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Hello", "UninstallString",0,"rundll32.exe setupapi,InstallHinfSection DefaultUnInstall 132 %10%\Hello\Hello.inf"
; #### UNINSTALLER ####
[DefaultUnInstall]
DelReg=del-registry-section
DelFiles=Delete.files
[del-registry-section]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Hello"
[Delete.files]
ReadMe.txt
hello.infInstructions To Run:
Just Right Click Hello.inf file in the Explorer, and Select Install from the Shortcut menu. This doesn't Display any Hello World String to Screen, Instead it Install a Sample Hello Application. It will Do
- Create a Folder "Hello" under Windows Folder.
- Copy Readme.txt, Hello.inf file to C:\Windows\Hello Folder
- Add Registry Entry so that it can be displayed and Uninstall from Add Remove Program.
- Go To Add Remove Program, See the Entry of Hello World, Say uninstall.
- All the Files which has been Copied [Readme.txt, Hello.inf] will be Deleted.
- Remove Registry Entry.
- Note that Hello folder in Windows will not be Deleted [because INF files can't Delete Folders], you can Delete this folder Safely.
This is a Small Application, which Display the Power of the INF Installers. If you are interested and want more Details about INF files then Read this Article.
Description:
INF file don't created for interactions [Input/Output Strings]. this is for automatic installation, You have seen automatic hardware detections and Installations on Windows, all this is Possible because of the INF files. for more Detailed description Read this Article.
Ö Source Code : Hello.pdf %Hello World in Portable Document Format (PDF)
%PDF-1.2
1 0 obj
<<
/Type /Page
/Parent 5 0 R
/Resources 3 0 R
/Contents 2 0 R
>>
endobj
2 0 obj
<<
/Length 51
>>
stream
BT
/F1 24 Tf
1 0 0 1 260 600 Tm
(Hello World!)Tj
ET
endstream
endobj
3 0 obj
<<
/ProcSet[/PDF/Text]
/Font <</F1 4 0 R >>
>>
endobj
4 0 obj
<<
/Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Arial
>>
endobj
5 0 obj
<<
/Type /Pages
/Kids [ 1 0 R ]
/Count 1
/MediaBox
[ 0 0 612 792 ]
>>
endobj
6 0 obj
<<
/Type /Catalog
/Pages 5 0 R
>>
endobj
trailer
<<
/Root 6 0 R
>>Instructions To Run:
Just Double Click Hello.pdf file in the Explorer. It will open on the Adobe Acrobat Reader.
Description:
PDF is the famous format on the internet, for publishing Forms and Documents, It will Display and Print Exactly Same on all the Computers. Probably You have encountered this type of file on Net.
Copyright © 2005
Lalit K Chaudhary
All the Applications and Codes
are Authorized to Owner.
You can use it, Distribute it But U can't Modify or Take Credit of
It, To Get full Info See
License
Contact At:
Lalit_9876@yahoo.com or
Truelogic@Truelogic.cjb.Net
Last updated : Sunday ,October 30, 2005