2 single: Getting Started - First Style; Introduction
4 =============================
5 Getting Started - First Style
6 =============================
9 pair: Getting Started - First Style; Hello World
14 The next program prints the Hello World message on the screen (std-out).
21 pair: Getting Started - First Style; Run the program
26 to run the program, save the code in a file, for example : hello.ring
27 then from the command line or terminal, run it using Ring
35 pair: Getting Started - First Style; Create Executable File
37 Create Executable File
38 ======================
40 Using Ring2EXE we can create executable file for our application
44 ring2exe hello.ring -static
47 pair: Getting Started - First Style; Not Case-Sensitive
52 Since the Ring language is not case-sensitive, the same program can
53 be written in different styles
55 .. tip:: It's better to select one style and use it in all of the program source code
67 pair: Getting Started - First Style; Multi-Line literals
72 Using Ring we can write multi-line literal, see the next example
78 Welcome to the Ring programming language
83 Also you can use the nl variable to insert new line
84 and you can use the + operator to concatenate strings
86 As we have NL for new lines, we have Tab and CR (Carriage return) too!
88 .. note:: nl value means a new line and the actual codes that
89 represent a newline is different between operating systems
93 See "Hello" + nl + "Welcome to the Ring programming language" +
97 pair: Getting Started - First Style; Getting Input
102 You can get the input from the user using the give command
106 See "What is your name? "
111 pair: Getting Started - First Style; No Explicit End For Statements
113 No Explicit End For Statements
114 ==============================
116 You don't need to use ';' or press ENTER to separate statements.
117 The previous program can be written in one line.
121 See "What is your name? " give cName see "Hello " + cName
124 pair: Getting Started - First Style; Using ? to print expression then new line
126 Using ? to print expression then new line
127 =========================================
129 It's common to print new line after printing an expression, We can use the ? operator to do that!
157 pair: Getting Started - First Style; Writing Comments
162 We can write one line comments and multi-line comments
164 The comment starts with # or //
166 Multi-lines comments are written between /* and */
172 Program Name : My first program using Ring
174 Author : Mahmoud Fayed
177 See "What is your name? " # print message on screen
178 give cName # get input from the user
179 see "Hello " + cName # say hello!
183 .. note:: Using // to comment a lines of code is just a code style.