SlideShare a Scribd company logo
Ring Documentation, Release 1.10
9.20 What is new in Ring 1.5.2?
• Documentation - Chapter “Applications developed in little hours” is updated
• Ring Notepad - Display programs output in the output window on all platforms
• Form Designer - Help Menu - Open CHM/PDF files without displaying the console window
• Form Designer - Better response to Resize/Move Events when moving the Mouse quickly
• Form Designer - New/Open/Save As, will open the Controller class in Ring Notepad
• Form Designer - Added “Close Form” option to the file menu
• Ring Notepad - Run, will save the current file (Also the opened Form) automatically
• GetQuotesHistory Application - Updated to work on MacOS X and Qt 5.2
• Calculator Application - Updated to include more features!
• RingVM - Classification for Environment Errors (Check Chapter : Language Reference)
• RingQt - New methods added to QAllEvents for faster Events execution
• RingQt - Fusion Black Style - Better colors for disabled controls
• Scripts - For building Ring on Fedora Linux (Check Chapter : Building From Source Code)
Screen Shot:
9.20. What is new in Ring 1.5.2? 138
Ring Documentation, Release 1.10
9.21 What is new in Ring 1.5.3?
• Form Designer : Close Action will notify Ring Notepad to be able to open the Form again
• Form Designer : Save Action will open the controller class in Ring Notepad
• Form Designer : Keep current control selected when selecting many controls using CTRL Key
• Form Designer : Nice form back color when used in Ring Notepad (Style: Modern Black)
• RingOpenSSL : Updated to support newer versions like OpenSSL 1.1
• Building Scripts : Updated to work on Fedora 26 (64bit)
• OpenGL : New Sample - Many Cubes (samples/3D/manycubes)
Screen Shot:
9.21. What is new in Ring 1.5.3? 139
Ring Documentation, Release 1.10
• RingQt : Add QDateTime Class
• RingQt : New methods added to QMenu and QCursor Classes
Example:
load "guilib.ring"
new qApp {
win = new qwidget() {
setwindowtitle("Context Menu")
resize(400,400)
myfilter = new qAllEvents(win) {
setContextmenuEvent("mymenu()")
}
installeventfilter(myfilter)
show()
}
exec()
}
func mymenu
new qMenu(win) {
9.21. What is new in Ring 1.5.3? 140
Ring Documentation, Release 1.10
oAction = new qAction(win) {
settext("new")
SetCLickevent("See :New")
}
addaction(oAction)
oAction = new qAction(win) {
settext("open")
SetCLickevent("See :Open")
}
addaction(oAction)
oAction = new qAction(win) {
settext("save")
SetCLickevent("See :Save")
}
addaction(oAction)
oAction = new qAction(win) {
settext("close")
SetCLickevent("See :Close")
}
addaction(oAction)
oCursor = new qCursor()
exec(oCursor.pos())
}
• Compiler : Support using _ in numbers
Example:
x = 1_000_000
see type(x)+nl
see x+1+nl
Output:
NUMBER
100000001
• Compiler : Support using f after numbers
Example:
x = 19.99f
see type(x) + nl
Output:
NUMBER
• Google API Shortener Application
Screen Shots:
9.21. What is new in Ring 1.5.3? 141
Ring Documentation, Release 1.10
• TicTacToe 3D Game
Screen Shot:
9.22 What is new in Ring 1.5.4?
• CalmoSoft Fifteen Puzzle Game 3D
• Ring Notepad - New Styles
9.22. What is new in Ring 1.5.4? 142
Ring Documentation, Release 1.10
• Ring Notepad - Better Toolbar Style
• Ring Notepad - View Modes
• Ring Notepad - QPlainTextEdit - don’t set back color for the scroll bars
• Ring Notepad - Style Fusion (White) - use Silver color for comments
• Ring Notepad - Tab and Shift-Tab - Indent multiple lines
• Form Designer - Better Toolbar Style
• Form Designer - Nice backcolor for Window Flags and Menubar Designer
• Form Designer - Default back color for controls
• RingQt - Added grab() and windowHandle() methods to QWidget class
• RingQt - Added new methods to QPixmap Class
• RingQt - Added Classes :-
– QScreen
– QWindow
– QGuiApplication
– QTextBrowser
• Code Generator for Extensions - Nonew Option - Support Parent Class
• Ring VM - Internal Implementation - Pass state to Strings and Lists objects
• Ring VM - Garbage Collector - Memory Pool for Small Objects
• Ring VM - Better code for Saving/Restoring the State
9.22. What is new in Ring 1.5.4? 143
CHAPTER
TEN
WHAT IS NEW IN RING 1.4?
In this chapter we will learn about the changes and new features in Ring 1.4 release.
10.1 List of changes and new features
Ring 1.4 comes with many new features
• Change: Basic Extensions are separated from RingVM
• The Natural Library
• New Style is added to Ring Notepad
• RingREPL
• Convert between Numbers and Bytes
• Better StdLib
• Better WebLib
• Better RingQt
• Qt Class Convertor
10.2 Change: Basic Extensions are separated from RingVM
In Ring 1.4 the next libraries are separated from RingVM
• RingODBC
• RingMySQL
• RingSQLite
• RingOpenSSL
• RingInternet
To use these libraries, Use the Load command.
load "odbclib.ring"
# use ODBC Functions
load "mysqllib.ring"
# use MySQL Functions
144
Ring Documentation, Release 1.10
load "sqlitelib.ring"
# use SQLite Functions
load "openssllib.ring"
# use OpenSSL Functions ( Hash and Security functions)
load "internetlib.ring"
# use Internet Functions ( Download() and SendEmail() )
If you will use all of these libraries, You can just use stdlib.ring And the stdlib.ring will load odbclib.ring, mysqllib.ring,
sqlitelib.ring, opensslib.ring and internetlib.ring files.
load "stdlib.ring"
10.3 The Natural Library
Ring 1.4 comes with the Natural Library to quickly define a language that contains a group of commands.
We will write the natural code in a Text file, for example program.txt
File: program.txt
Welcome to the Ring programming language!
What you are reading now is not comments, I swear!
After many years of programming I decided to think different about
programming and solve the problems in a better way.
We are writing commands or code and the Ring language is reading
it to understand us! Sure, What you are seeing now is
just ***part of the code - Not the Complete Program***
You have to write little things before and after this
part to be able to run it!
It is the natural part of our code where we can write in English,
Arabic or any Natural Language Then we will tell the computer
through the Ring language what must happens! in a way that we can scale
for large frameworks and programs.
Just imagine what will happens to the world of programming once
we create many powerful frameworks using the Ring language that
uses this way (Natural Programming).
For example When we say Hello to the Machine, It can reply! and when we
say count from 1 to 5 it will understand us, Also if
we said count from 5 to 1 it will
understand us too! You can see the Output window!
This Goal is not new, but the Ring language comes
with an innovative solution to this problem.
Output:
Hello, Sir!
The Numbers!
10.3. The Natural Library 145
Ring Documentation, Release 1.10
1
2
3
4
5
I will count Again!
5
4
3
2
1
To execute the natural code, We have start.ring
In start.ring we define the language and the commands.
File: start.ring
load "stdlib.ring"
load "naturallib.ring"
New NaturalLanguage {
SetLanguageName(:MyLanguage)
SetCommandsPath(CurrentDir()+"/../command")
SetPackageName("MyLanguage.Natural")
UseCommand(:Hello)
UseCommand(:Count)
RunFile("program.txt")
}
We defined a language called MyLanguage, We have folder for the language commands.
Each command will define a class that belong to the MyLanguage.Natural package.
We will define two commands, Hello and Count.
So we must have two files for defining the commands in the CurrentDir()+”/../command” folder
File: hello.ring
DefineNaturalCommand.SyntaxIsKeyword([
:Package = "MyLanguage.Natural",
:Keyword = :hello,
:Function = func {
See "Hello, Sir!" + nl + nl
}
])
File: count.ring
10.3. The Natural Library 146
Ring Documentation, Release 1.10
DefineNaturalCommand.SyntaxIsKeywordNumberNumber([
:Package = "MyLanguage.Natural",
:Keyword = :count,
:Function = func {
if not isattribute(self,:count_times) {
AddAttribute(self,:count_times)
Count_Times = 0
}
if Expr(1) > Expr(2) {
nStep = -1
else
nStep = 1
}
if Count_Times = 0 {
see nl+"The Numbers!" + nl
Count_Times++
else
see nl + "I will count Again!" +nl
}
for x = Expr(1) to Expr(2) step nStep {
see nl+x+nl
}
CommandReturn(fabs(Expr(1)-Expr(2))+1)
}
])
10.4 New Style is added to Ring Notepad
In Ring Notepad - From View - Styles - Select the (Modern) Style
Screen Shot:
10.4. New Style is added to Ring Notepad 147

More Related Content

PDF
The Ring programming language version 1.5.4 book - Part 11 of 185
PDF
The Ring programming language version 1.5.3 book - Part 11 of 184
PDF
The Ring programming language version 1.9 book - Part 17 of 210
PDF
Netty training
PDF
ORTC SVC SimulCast
PPTX
Developing High Performance Application with Aerospike & Go
PDF
Golang Performance : microbenchmarks, profilers, and a war story
PDF
Types - slice, map, new, make, struct - Gopherlabs
The Ring programming language version 1.5.4 book - Part 11 of 185
The Ring programming language version 1.5.3 book - Part 11 of 184
The Ring programming language version 1.9 book - Part 17 of 210
Netty training
ORTC SVC SimulCast
Developing High Performance Application with Aerospike & Go
Golang Performance : microbenchmarks, profilers, and a war story
Types - slice, map, new, make, struct - Gopherlabs

What's hot (20)

ODP
Using Grails to power your electric car
PDF
10 reasons to be excited about go
PPTX
SignalFx Kafka Consumer Optimization
PPTX
Kafka y python
PPTX
Akka-demy (a.k.a. How to build stateful distributed systems) I/II
PDF
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Ben...
PDF
Mасштабирование микросервисов на Go, Matt Heath (Hailo)
PDF
Rihards Olups - Encrypting Daemon Traffic With Zabbix 3.0
PDF
DaNode - A home made web server in D
PDF
Treasure Data Summer Internship 2016
PDF
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
PDF
Understanding how concurrency work in os
PPTX
what is docker
PDF
OpenAPI and gRPC Side by-Side
PDF
The Ring programming language version 1.5.2 book - Part 12 of 181
PDF
Kernel Recipes 2018 - A year of fixing Coverity issues all over the Linux ker...
PPTX
Finagle Your Own Codec - Scala By The Bay 2016
PDF
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...
PDF
Scaling ingest pipelines with high performance computing principles - Rajiv K...
PDF
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Using Grails to power your electric car
10 reasons to be excited about go
SignalFx Kafka Consumer Optimization
Kafka y python
Akka-demy (a.k.a. How to build stateful distributed systems) I/II
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Ben...
Mасштабирование микросервисов на Go, Matt Heath (Hailo)
Rihards Olups - Encrypting Daemon Traffic With Zabbix 3.0
DaNode - A home made web server in D
Treasure Data Summer Internship 2016
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Understanding how concurrency work in os
what is docker
OpenAPI and gRPC Side by-Side
The Ring programming language version 1.5.2 book - Part 12 of 181
Kernel Recipes 2018 - A year of fixing Coverity issues all over the Linux ker...
Finagle Your Own Codec - Scala By The Bay 2016
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...
Scaling ingest pipelines with high performance computing principles - Rajiv K...
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Ad

Similar to The Ring programming language version 1.10 book - Part 18 of 212 (20)

PDF
The Ring programming language version 1.8 book - Part 15 of 202
PDF
The Ring programming language version 1.5.1 book - Part 10 of 180
PDF
The Ring programming language version 1.5.3 book - Part 194 of 194
PDF
The Ring programming language version 1.4 book - Part 3 of 30
PDF
The Ring programming language version 1.5.4 book - Part 185 of 185
PDF
The Ring programming language version 1.10 book - Part 208 of 212
PDF
The Ring programming language version 1.6 book - Part 189 of 189
PDF
The Ring programming language version 1.10 book - Part 212 of 212
PDF
The Ring programming language version 1.5.1 book - Part 13 of 180
PDF
The Ring programming language version 1.5.4 book - Part 14 of 185
PDF
The Ring programming language version 1.5.2 book - Part 181 of 181
PDF
The Ring programming language version 1.9 book - Part 206 of 210
PDF
The Ring programming language version 1.5.3 book - Part 14 of 184
PDF
The Ring programming language version 1.6 book - Part 16 of 189
PDF
The Ring programming language version 1.6 book - Part 13 of 189
PDF
The Ring programming language version 1.2 book - Part 84 of 84
PDF
The Ring programming language version 1.8 book - Part 200 of 202
PDF
The Ring programming language version 1.10 book - Part 13 of 212
PDF
The Ring programming language version 1.5.3 book - Part 7 of 184
PDF
The Ring programming language version 1.7 book - Part 17 of 196
The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.5.1 book - Part 10 of 180
The Ring programming language version 1.5.3 book - Part 194 of 194
The Ring programming language version 1.4 book - Part 3 of 30
The Ring programming language version 1.5.4 book - Part 185 of 185
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.6 book - Part 189 of 189
The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.5.1 book - Part 13 of 180
The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.2 book - Part 181 of 181
The Ring programming language version 1.9 book - Part 206 of 210
The Ring programming language version 1.5.3 book - Part 14 of 184
The Ring programming language version 1.6 book - Part 16 of 189
The Ring programming language version 1.6 book - Part 13 of 189
The Ring programming language version 1.2 book - Part 84 of 84
The Ring programming language version 1.8 book - Part 200 of 202
The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.5.3 book - Part 7 of 184
The Ring programming language version 1.7 book - Part 17 of 196
Ad

More from Mahmoud Samir Fayed (20)

PDF
The Ring programming language version 1.10 book - Part 211 of 212
PDF
The Ring programming language version 1.10 book - Part 210 of 212
PDF
The Ring programming language version 1.10 book - Part 207 of 212
PDF
The Ring programming language version 1.10 book - Part 205 of 212
PDF
The Ring programming language version 1.10 book - Part 206 of 212
PDF
The Ring programming language version 1.10 book - Part 204 of 212
PDF
The Ring programming language version 1.10 book - Part 203 of 212
PDF
The Ring programming language version 1.10 book - Part 202 of 212
PDF
The Ring programming language version 1.10 book - Part 201 of 212
PDF
The Ring programming language version 1.10 book - Part 200 of 212
PDF
The Ring programming language version 1.10 book - Part 199 of 212
PDF
The Ring programming language version 1.10 book - Part 198 of 212
PDF
The Ring programming language version 1.10 book - Part 197 of 212
PDF
The Ring programming language version 1.10 book - Part 196 of 212
PDF
The Ring programming language version 1.10 book - Part 195 of 212
PDF
The Ring programming language version 1.10 book - Part 194 of 212
PDF
The Ring programming language version 1.10 book - Part 193 of 212
PDF
The Ring programming language version 1.10 book - Part 192 of 212
PDF
The Ring programming language version 1.10 book - Part 191 of 212
PDF
The Ring programming language version 1.10 book - Part 190 of 212
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 191 of 212
The Ring programming language version 1.10 book - Part 190 of 212

Recently uploaded (20)

PDF
System and Network Administraation Chapter 3
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Introduction to Artificial Intelligence
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Digital Strategies for Manufacturing Companies
PDF
AI in Product Development-omnex systems
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
ai tools demonstartion for schools and inter college
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Transform Your Business with a Software ERP System
System and Network Administraation Chapter 3
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Operating system designcfffgfgggggggvggggggggg
VVF-Customer-Presentation2025-Ver1.9.pptx
Introduction to Artificial Intelligence
How Creative Agencies Leverage Project Management Software.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Digital Strategies for Manufacturing Companies
AI in Product Development-omnex systems
wealthsignaloriginal-com-DS-text-... (1).pdf
Odoo POS Development Services by CandidRoot Solutions
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Adobe Illustrator 28.6 Crack My Vision of Vector Design
ai tools demonstartion for schools and inter college
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Transform Your Business with a Software ERP System

The Ring programming language version 1.10 book - Part 18 of 212

  • 1. Ring Documentation, Release 1.10 9.20 What is new in Ring 1.5.2? • Documentation - Chapter “Applications developed in little hours” is updated • Ring Notepad - Display programs output in the output window on all platforms • Form Designer - Help Menu - Open CHM/PDF files without displaying the console window • Form Designer - Better response to Resize/Move Events when moving the Mouse quickly • Form Designer - New/Open/Save As, will open the Controller class in Ring Notepad • Form Designer - Added “Close Form” option to the file menu • Ring Notepad - Run, will save the current file (Also the opened Form) automatically • GetQuotesHistory Application - Updated to work on MacOS X and Qt 5.2 • Calculator Application - Updated to include more features! • RingVM - Classification for Environment Errors (Check Chapter : Language Reference) • RingQt - New methods added to QAllEvents for faster Events execution • RingQt - Fusion Black Style - Better colors for disabled controls • Scripts - For building Ring on Fedora Linux (Check Chapter : Building From Source Code) Screen Shot: 9.20. What is new in Ring 1.5.2? 138
  • 2. Ring Documentation, Release 1.10 9.21 What is new in Ring 1.5.3? • Form Designer : Close Action will notify Ring Notepad to be able to open the Form again • Form Designer : Save Action will open the controller class in Ring Notepad • Form Designer : Keep current control selected when selecting many controls using CTRL Key • Form Designer : Nice form back color when used in Ring Notepad (Style: Modern Black) • RingOpenSSL : Updated to support newer versions like OpenSSL 1.1 • Building Scripts : Updated to work on Fedora 26 (64bit) • OpenGL : New Sample - Many Cubes (samples/3D/manycubes) Screen Shot: 9.21. What is new in Ring 1.5.3? 139
  • 3. Ring Documentation, Release 1.10 • RingQt : Add QDateTime Class • RingQt : New methods added to QMenu and QCursor Classes Example: load "guilib.ring" new qApp { win = new qwidget() { setwindowtitle("Context Menu") resize(400,400) myfilter = new qAllEvents(win) { setContextmenuEvent("mymenu()") } installeventfilter(myfilter) show() } exec() } func mymenu new qMenu(win) { 9.21. What is new in Ring 1.5.3? 140
  • 4. Ring Documentation, Release 1.10 oAction = new qAction(win) { settext("new") SetCLickevent("See :New") } addaction(oAction) oAction = new qAction(win) { settext("open") SetCLickevent("See :Open") } addaction(oAction) oAction = new qAction(win) { settext("save") SetCLickevent("See :Save") } addaction(oAction) oAction = new qAction(win) { settext("close") SetCLickevent("See :Close") } addaction(oAction) oCursor = new qCursor() exec(oCursor.pos()) } • Compiler : Support using _ in numbers Example: x = 1_000_000 see type(x)+nl see x+1+nl Output: NUMBER 100000001 • Compiler : Support using f after numbers Example: x = 19.99f see type(x) + nl Output: NUMBER • Google API Shortener Application Screen Shots: 9.21. What is new in Ring 1.5.3? 141
  • 5. Ring Documentation, Release 1.10 • TicTacToe 3D Game Screen Shot: 9.22 What is new in Ring 1.5.4? • CalmoSoft Fifteen Puzzle Game 3D • Ring Notepad - New Styles 9.22. What is new in Ring 1.5.4? 142
  • 6. Ring Documentation, Release 1.10 • Ring Notepad - Better Toolbar Style • Ring Notepad - View Modes • Ring Notepad - QPlainTextEdit - don’t set back color for the scroll bars • Ring Notepad - Style Fusion (White) - use Silver color for comments • Ring Notepad - Tab and Shift-Tab - Indent multiple lines • Form Designer - Better Toolbar Style • Form Designer - Nice backcolor for Window Flags and Menubar Designer • Form Designer - Default back color for controls • RingQt - Added grab() and windowHandle() methods to QWidget class • RingQt - Added new methods to QPixmap Class • RingQt - Added Classes :- – QScreen – QWindow – QGuiApplication – QTextBrowser • Code Generator for Extensions - Nonew Option - Support Parent Class • Ring VM - Internal Implementation - Pass state to Strings and Lists objects • Ring VM - Garbage Collector - Memory Pool for Small Objects • Ring VM - Better code for Saving/Restoring the State 9.22. What is new in Ring 1.5.4? 143
  • 7. CHAPTER TEN WHAT IS NEW IN RING 1.4? In this chapter we will learn about the changes and new features in Ring 1.4 release. 10.1 List of changes and new features Ring 1.4 comes with many new features • Change: Basic Extensions are separated from RingVM • The Natural Library • New Style is added to Ring Notepad • RingREPL • Convert between Numbers and Bytes • Better StdLib • Better WebLib • Better RingQt • Qt Class Convertor 10.2 Change: Basic Extensions are separated from RingVM In Ring 1.4 the next libraries are separated from RingVM • RingODBC • RingMySQL • RingSQLite • RingOpenSSL • RingInternet To use these libraries, Use the Load command. load "odbclib.ring" # use ODBC Functions load "mysqllib.ring" # use MySQL Functions 144
  • 8. Ring Documentation, Release 1.10 load "sqlitelib.ring" # use SQLite Functions load "openssllib.ring" # use OpenSSL Functions ( Hash and Security functions) load "internetlib.ring" # use Internet Functions ( Download() and SendEmail() ) If you will use all of these libraries, You can just use stdlib.ring And the stdlib.ring will load odbclib.ring, mysqllib.ring, sqlitelib.ring, opensslib.ring and internetlib.ring files. load "stdlib.ring" 10.3 The Natural Library Ring 1.4 comes with the Natural Library to quickly define a language that contains a group of commands. We will write the natural code in a Text file, for example program.txt File: program.txt Welcome to the Ring programming language! What you are reading now is not comments, I swear! After many years of programming I decided to think different about programming and solve the problems in a better way. We are writing commands or code and the Ring language is reading it to understand us! Sure, What you are seeing now is just ***part of the code - Not the Complete Program*** You have to write little things before and after this part to be able to run it! It is the natural part of our code where we can write in English, Arabic or any Natural Language Then we will tell the computer through the Ring language what must happens! in a way that we can scale for large frameworks and programs. Just imagine what will happens to the world of programming once we create many powerful frameworks using the Ring language that uses this way (Natural Programming). For example When we say Hello to the Machine, It can reply! and when we say count from 1 to 5 it will understand us, Also if we said count from 5 to 1 it will understand us too! You can see the Output window! This Goal is not new, but the Ring language comes with an innovative solution to this problem. Output: Hello, Sir! The Numbers! 10.3. The Natural Library 145
  • 9. Ring Documentation, Release 1.10 1 2 3 4 5 I will count Again! 5 4 3 2 1 To execute the natural code, We have start.ring In start.ring we define the language and the commands. File: start.ring load "stdlib.ring" load "naturallib.ring" New NaturalLanguage { SetLanguageName(:MyLanguage) SetCommandsPath(CurrentDir()+"/../command") SetPackageName("MyLanguage.Natural") UseCommand(:Hello) UseCommand(:Count) RunFile("program.txt") } We defined a language called MyLanguage, We have folder for the language commands. Each command will define a class that belong to the MyLanguage.Natural package. We will define two commands, Hello and Count. So we must have two files for defining the commands in the CurrentDir()+”/../command” folder File: hello.ring DefineNaturalCommand.SyntaxIsKeyword([ :Package = "MyLanguage.Natural", :Keyword = :hello, :Function = func { See "Hello, Sir!" + nl + nl } ]) File: count.ring 10.3. The Natural Library 146
  • 10. Ring Documentation, Release 1.10 DefineNaturalCommand.SyntaxIsKeywordNumberNumber([ :Package = "MyLanguage.Natural", :Keyword = :count, :Function = func { if not isattribute(self,:count_times) { AddAttribute(self,:count_times) Count_Times = 0 } if Expr(1) > Expr(2) { nStep = -1 else nStep = 1 } if Count_Times = 0 { see nl+"The Numbers!" + nl Count_Times++ else see nl + "I will count Again!" +nl } for x = Expr(1) to Expr(2) step nStep { see nl+x+nl } CommandReturn(fabs(Expr(1)-Expr(2))+1) } ]) 10.4 New Style is added to Ring Notepad In Ring Notepad - From View - Styles - Select the (Modern) Style Screen Shot: 10.4. New Style is added to Ring Notepad 147