You are on page 1of 10

Ring Documentation, Release 1.

16.10 The Program Menu

From this menu we can run the programs


Also we can set the Main file in the project

16.11 The Browser Menu

From this menu we can quickly open common links in the browser

16.10. The Program Menu 172


Ring Documentation, Release 1.7

16.12 The Tools Menu

From this menu we can run the Form Designer in separate window
Also we can run the REPL (Read-Eval-Print-Loop) application

16.13 The Distribute Menu

From this menu we can build an executable file for the application
Also we can prepare the application for distribution

16.12. The Tools Menu 173


Ring Documentation, Release 1.7

16.14 The Help Menu

From this menu we can get the help files (CHM & PDF)

16.14. The Help Menu 174


CHAPTER

SEVENTEEN

USING OTHER CODE EDITORS

In the Ring/Editor folder you will find extensions for the next editors
• Notepad++
• Geany
• Atom
• Sublime Text 2
• Visual Studio IDE
• Emacs

17.1 Using Notepad++

Folder : ring/editor/notepad_plus_plus
• Open Notepad++
• Open the “Language” menu
• Select “Define your language...”
• Click “Import...”
• select Ring.xml
• Select “OK” on the “Import successful” dialog and close the “User Defined Language” dialog/panel
• You may need to restart notepad++

175
Ring Documentation, Release 1.7

17.2 Using Geany

Folder : ring/editor/geany
• Run Geany editor
• Click on “Tools -> configuration files -> filetypes_extensions.conf” menu
• Add this line “Ring=*.ring;” without quotes after [Extensions]
• In unbuntu copy file “filetypes.Ring.conf” to folder “/home/USERNAME/filetypes.Ring.conf”
• You can run your files by pressing F5 button

17.2. Using Geany 176


Ring Documentation, Release 1.7

17.3 Using Atom

Folder : ring/editor/atom
Just Copy the folder atom-language-ring to the next path
"C:\Users\{UserName}\.atom\Packages"

17.3. Using Atom 177


Ring Documentation, Release 1.7

17.4 Using Sublime Text 2

Folder : ring/editor/sublime text 2


In the folder Sublime_Text_2 you will find the next three files
1 - ring.json-tmlanguage
2 - ring.sublime-build
3 - ring.tmlanguage
Just Copy the files to the next path
"C:\Users\{UserName}\AppData\Roaming\Sublime Text 2\Packages\User\"

The file ring.sublime-build includes the next line


"cmd": ["B:\\ring\\bin\\ring.exe","$file"],

You can modify it according to the ring.exe path in your machine

17.4. Using Sublime Text 2 178


Ring Documentation, Release 1.7

17.5 Using Visual Studio IDE

Folder : ring/editor/visualstudio
Check the ReadMe file for installation instructions.

17.5. Using Visual Studio IDE 179


Ring Documentation, Release 1.7

17.6 Using Emacs Editor

Folder : ring/editor/emacs
Check the ReadMe file for installation instructions.
Screen Shot:

17.6. Using Emacs Editor 180


CHAPTER

EIGHTEEN

VARIABLES

To create a new variable, you just need to determine the variable name & value. The value will determine the variable
type and you can change the value to switch between the types using the same variable name.
Syntax:
<Variable Name> = <Value>

Tip: The operator ‘=’ is used here as an Assignment operator and the same operator can be used in conditions, but
for testing equality of expressions.

Note: The Variable will contains the real value (not a reference). This means that once you change the variable value,
the old value will be removed from memory (even if the variable contains a list or object).

18.1 Dynamic Typing

Ring is a dynamic programming language that uses Dynamic Typing.


x = "Hello" # x is a string
see x + nl
x = 5 # x is a number (int)
see x + nl
x = 1.2 # x is a number (double)
see x + nl
x = [1,2,3,4] # x is a list
see x # print list items
x = date() # x is a string contains date
see x + nl
x = time() # x is a string contains time
see x + nl
x = true # x is a number (logical value = 1)
see x + nl
x = false # x is a number (logical value = 0)
see x + nl

18.2 Deep Copy

We can use the assignment operator ‘=’ to copy variables. We can do that to copy values like strings & numbers. Also,
we can copy complete lists & objects. The assignment operator will do a complete duplication for us. This operation
called Deep Copy

181

You might also like