Walnut/Ordinary Programming/Hello World

From Erights

Jump to: navigation, search

Hello World

We will show Hello World as both an E program and a rune script. Rune first: just type

 ? println("Hello World")

when you hit the Enter key, you will get

 Hello World

To run an E program, put "println("Hello World")" into a text file. Make sure the file extension is ".e" (to run Swing-based apps, use extension ".e-awt", and to use SWT-based apps, use ".e-swt"). Type

 java -jar e.jar --rune textfilename.e

into a command shell (a DOS window under Windows, or a Cygwin or Unix shell, such as bash). The greeting will be printed to your display.

Now that you have started rune and run Hello World, it would be a good time to look at your trace log folder for the first time to make sure you know where to look. If you are on Windows 95, the trace log will default to <Windows directory>\temp\etrace. The etrace folder location can always be found in the eprops.txt file in the E installation directory (under Unix, you will have created eprops.txt yourself from eprops-template.txt). You should, after launching rune, find one file in the trace folder, which is the trace log created for the rune session. It will probably be empty, unless you have gone wild experimenting with Hello World.

Personal tools
more tools