EnglishРусский  

   hello

   square

   easymath

   runini

   easyhtml

   calendar

   samefiles

   To be continued

Ads

Installer and installation software
Commercial and Freeware installers.

hello

There is a tradition in programming tutorials to show the code that prints "Hello, World!" on the computer screen. We will adhere to that tradition by showing you the Gentee code that produces "Hello World:"

Example 1

func hello <main>
{
   print( "Hello, World!" )
   getch()
}

To understand how the code displays the results printed on your screen, you need to understand certain concepts.

The "Hello World" printed on the screen is called a "function." A function is a type of procedure or routine that performs a specific task. Some programming languages make a distinction between a function, which returns a value, and a procedure, which performs a specific task but does not return a value In the case of Gentee, functions are denoted by the operation set that performs any task.

Functions can be called from other ones. Functions are described by the keyword func in Gentee. The function with the name hello and the attribute main have just been mentioned, the attribute means that this function will be run after loading the program.

print( "Hello, World!" )

print is a function call outputting the specified string.

A string is a series of characters manipulated as a group. A character string is often specified by enclosing the characters in quotes. For example, WASHINGTON would be a name, but "WASHINGTON" would be character strings. In Gentee, strings are enclosed in double quotes. In other words, the quote marks help you define a string.

After we designate a character string, we call another function getch that results in a keystroke delay.

More information about this coding can be found in the documentation. In the lessons you can also find information about other functions and methods.

Now, let's talk about strings. There is a command character '\', that performs some actions depending on the following characters. This example demonstrates some of them:

\n represents a new line.
\\ represents the symbol: backslash '\'.

In addition to this, Gentee saves line feeds within the string. A line feed is a code that moves the cursor on a display screen down one line. In the example below, the following strings are equivalents.

"Hello, World!
Hello, World!" 
"Hello, World!\nHello, World!"

Exercise 2

Make a program "Hello, World!" that prompts the user to press any key.

Source