SlideShare a Scribd company logo
Ring Documentation, Release 1.5.3
2. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartController.ring
6.3 Better Ring Notepad
1. Using QPlainTextEdit instead of QTextEdit
2. Displaying the line number for each line in the source code file.
Screen Shot:
3. Auto-Complete for Ring functions names, classes and words in the opened file.
6.3. Better Ring Notepad 95
Ring Documentation, Release 1.5.3
4. Functions and Methods List
6.3. Better Ring Notepad 96
Ring Documentation, Release 1.5.3
5. Output Window
6. Classes List
6.3. Better Ring Notepad 97
Ring Documentation, Release 1.5.3
7. Change the Current Style
6.4 Ring mode for Emacs Editor
Ring 1.3 comes with Ring mode for Emacs Editor
Screen Shot:
6.4. Ring mode for Emacs Editor 98
Ring Documentation, Release 1.5.3
6.5 Better StdLib
The StdLib is updated to include the next functions
• SplitMany()
• JustFilePath()
• JustFileName()
6.6 Better Loop|Exit Command
The Loop|Exit command is updated to accept Expressions after the command (not only numbers).
The syntax:
Loop|Exit [Number]
Changed to
Loop|Exit [Expression]
Example
XLoop = 2 # The outer loop
YLoop = 1 # The first inner loop
for x = 1 to 10
for y = 1 to 10
see "x=" + x + " y=" + y + nl
if x = 3 and y = 5
exit XLoop
ok
6.5. Better StdLib 99
Ring Documentation, Release 1.5.3
next
next
6.7 New Functions
• PackageName() function
• Swap() function
Example:
aList = [:one,:two,:four,:three]
see aList
see copy("*",50) + nl
swap(aList,3,4)
see aList
Output
one
two
four
three
**************************************************
one
two
three
four
6.8 Return Self by Reference
In this release, using Return Self in class methods will return the object by reference.
Example:
mylist = [new mytest() {
see self
x = 20
see self
}]
see mylist
class mytest
x = 15
func init
return self # Return by reference
Output
x: 15.000000
x: 20.000000
x: 20.000000
6.7. New Functions 100
Ring Documentation, Release 1.5.3
6.9 Using ‘<’ and ‘:’ operators as ‘from’ keyword
In this release of the Ring language we can use the ‘<’ and ‘:’ operators as the ‘from’ keyword
Syntax (1):
class Cat from Animal
Syntax (2):
class Cat < Animal
Syntax (3):
class Cat : Animal
6.10 Embedding Ring in Ring without sharing the State
From Ring 1.0 we already have functions for embedding Ring in the C language. Also we can execute Ring code
inside Ring programs using the eval() function. In this release we provide functions for embedding Ring in Ring
programs without sharing the state.
Advantages:
1. Quick integration for Ring programs and applications together without conflicts.
2. Execute and run Ring code in safe environments that we can trace.
Example:
pState = ring_state_init()
ring_state_runcode(pState,"See 'Hello, World!'+nl")
ring_state_runcode(pState,"x = 10")
pState2 = ring_state_init()
ring_state_runcode(pState2,"See 'Hello, World!'+nl")
ring_state_runcode(pState2,"x = 20")
ring_state_runcode(pState,"see x +nl")
ring_state_runcode(pState2,"see x +nl")
v1 = ring_state_findvar(pState,"x")
v2 = ring_state_findvar(pState2,"x")
see v1[3] + nl
see V2[3] + nl
ring_state_delete(pState)
ring_state_delete(pState2)
Output:
Hello, World!
Hello, World!
10
20
10
20
6.9. Using ‘<’ and ‘:’ operators as ‘from’ keyword 101
Ring Documentation, Release 1.5.3
6.11 RingZip Library
Ring 1.3 comes with the RingZip library for creating, modifying and extracting *.zip files.
Example (1): Create myfile.zip contains 4 files
load "ziplib.ring"
oZip = zip_openfile("myfile.zip",'w')
zip_addfile(oZip,"test.c")
zip_addfile(oZip,"zip.c")
zip_addfile(oZip,"zip.h")
zip_addfile(oZip,"miniz.h")
zip_close(oZip)
Example (2): Extract myfile.zip to myfolder folder.
load "ziplib.ring"
zip_extract_allfiles("myfile.zip","myfolder")
Example (3): Print file names in the myfile.zip
load "ziplib.ring"
oZip = zip_openfile("myfile.zip",'r')
for x=1 to zip_filescount(oZip)
see zip_getfilenamebyindex(oZip,x) + nl
next
zip_close(oZip)
Example (4) : Using Classes instead of Functions
load "ziplib.ring"
new Zip {
SetFileName("myfile.zip")
Open("w")
AddFile("test.c")
AddFile("zip.c")
AddFile("zip.h")
AddFile("miniz.h")
Close()
}
6.12 Form Designer
Ring 1.3 comes with the Form Designer to quickly design your GUI application windows/forms and generate the Ring
source code.
It’s written in Ring (Around 8000 Lines of code) using Object-Oriented Programming and Meta-Programming.
We can run the From Designer from Ring Notepad
6.11. RingZip Library 102
Ring Documentation, Release 1.5.3
Also we can run the Form Designer in another window.
6.12. Form Designer 103
CHAPTER
SEVEN
WHAT IS NEW IN RING 1.2?
In this chapter we will learn about the changes and new features in Ring 1.2 release.
7.1 List of changes and new features
Ring 1.2 comes with many new features
• New Functions
• Better Functions
• Better Ring Notepad
• Better RingQt
• Objects Library for RingQt
• RingLibCurl
• Better Call Command
• Using NULL instead of NULLPointer()
• Display Warnings Option
• Better Quality
7.2 New Functions
• PtrCmp() Function is a new function that compare between C pointers like the GUI objects.
• PrevFileName() Function is added to return the previous active source file name.
• RingVM_CFunctionsList() Function is added to return a list of functions written in C.
• RingVM_FunctionsList() Function is added to return a list of functions written in Ring.
• RingVM_ClassesList() Function is added to return a list of Classes.
• RingVM_PackagesList() Function is added to return a list of Packages.
• RingVM_MemoryList() Function is added to return a list of Memory Scopes and Variables.
• RingVM_CallList() Function is added to return a list of the functions call list.
• RingVM_FilesList() Function is added to return a list of the Ring Files.
Example:
104

More Related Content

What's hot (20)

PDF
The Ring programming language version 1.5.3 book - Part 189 of 194
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.3 book - Part 92 of 184
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 102 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 88 of 196
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.4 book - Part 14 of 185
Mahmoud Samir Fayed
 
PDF
TDD by Controlling Dependencies
Jorge Ortiz
 
PDF
The Ring programming language version 1.10 book - Part 21 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 30 of 196
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 14 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.1 book - Part 11 of 180
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 7 of 196
Mahmoud Samir Fayed
 
PDF
Dagger & rxjava & retrofit
Ted Liang
 
PDF
The Ring programming language version 1.7 book - Part 79 of 196
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 35 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.4 book - Part 70 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.8 book - Part 14 of 202
Mahmoud Samir Fayed
 
PDF
JavaOne 2013: Java 8 - The Good Parts
Konrad Malawski
 
PPTX
Reactive programming with RxAndroid
Savvycom Savvycom
 
PDF
The Ring programming language version 1.7 book - Part 86 of 196
Mahmoud Samir Fayed
 
DOCX
Implementation of fix messages for fix 5.0 sp2 and fixt1.1 specification
Neeraj Kaushik
 
The Ring programming language version 1.5.3 book - Part 189 of 194
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 92 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 102 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 88 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 14 of 185
Mahmoud Samir Fayed
 
TDD by Controlling Dependencies
Jorge Ortiz
 
The Ring programming language version 1.10 book - Part 21 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 30 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 14 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 11 of 180
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 7 of 196
Mahmoud Samir Fayed
 
Dagger & rxjava & retrofit
Ted Liang
 
The Ring programming language version 1.7 book - Part 79 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 35 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 70 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 14 of 202
Mahmoud Samir Fayed
 
JavaOne 2013: Java 8 - The Good Parts
Konrad Malawski
 
Reactive programming with RxAndroid
Savvycom Savvycom
 
The Ring programming language version 1.7 book - Part 86 of 196
Mahmoud Samir Fayed
 
Implementation of fix messages for fix 5.0 sp2 and fixt1.1 specification
Neeraj Kaushik
 

Similar to The Ring programming language version 1.5.3 book - Part 13 of 184 (20)

PDF
The Ring programming language version 1.10 book - Part 13 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.2 book - Part 13 of 181
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 20 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.3 book - Part 6 of 88
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 212 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.3 book - Part 11 of 184
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.6 book - Part 14 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 11 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 15 of 196
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.3 book - Part 14 of 184
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.2 book - Part 84 of 84
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.4 book - Part 13 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.8 book - Part 11 of 202
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.6 book - Part 7 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.9 book - Part 9 of 210
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 92 of 196
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.1 book - Part 10 of 180
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.8 book - Part 18 of 202
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.4 book - Part 80 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.3 book - Part 8 of 88
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 13 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 13 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 20 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 6 of 88
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 212 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 11 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 14 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 11 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 15 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 14 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 84 of 84
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 13 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 11 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 7 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 9 of 210
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 92 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 10 of 180
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 18 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 80 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 8 of 88
Mahmoud Samir Fayed
 
Ad

More from Mahmoud Samir Fayed (20)

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

Recently uploaded (20)

DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 

The Ring programming language version 1.5.3 book - Part 13 of 184

  • 1. Ring Documentation, Release 1.5.3 2. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartController.ring 6.3 Better Ring Notepad 1. Using QPlainTextEdit instead of QTextEdit 2. Displaying the line number for each line in the source code file. Screen Shot: 3. Auto-Complete for Ring functions names, classes and words in the opened file. 6.3. Better Ring Notepad 95
  • 2. Ring Documentation, Release 1.5.3 4. Functions and Methods List 6.3. Better Ring Notepad 96
  • 3. Ring Documentation, Release 1.5.3 5. Output Window 6. Classes List 6.3. Better Ring Notepad 97
  • 4. Ring Documentation, Release 1.5.3 7. Change the Current Style 6.4 Ring mode for Emacs Editor Ring 1.3 comes with Ring mode for Emacs Editor Screen Shot: 6.4. Ring mode for Emacs Editor 98
  • 5. Ring Documentation, Release 1.5.3 6.5 Better StdLib The StdLib is updated to include the next functions • SplitMany() • JustFilePath() • JustFileName() 6.6 Better Loop|Exit Command The Loop|Exit command is updated to accept Expressions after the command (not only numbers). The syntax: Loop|Exit [Number] Changed to Loop|Exit [Expression] Example XLoop = 2 # The outer loop YLoop = 1 # The first inner loop for x = 1 to 10 for y = 1 to 10 see "x=" + x + " y=" + y + nl if x = 3 and y = 5 exit XLoop ok 6.5. Better StdLib 99
  • 6. Ring Documentation, Release 1.5.3 next next 6.7 New Functions • PackageName() function • Swap() function Example: aList = [:one,:two,:four,:three] see aList see copy("*",50) + nl swap(aList,3,4) see aList Output one two four three ************************************************** one two three four 6.8 Return Self by Reference In this release, using Return Self in class methods will return the object by reference. Example: mylist = [new mytest() { see self x = 20 see self }] see mylist class mytest x = 15 func init return self # Return by reference Output x: 15.000000 x: 20.000000 x: 20.000000 6.7. New Functions 100
  • 7. Ring Documentation, Release 1.5.3 6.9 Using ‘<’ and ‘:’ operators as ‘from’ keyword In this release of the Ring language we can use the ‘<’ and ‘:’ operators as the ‘from’ keyword Syntax (1): class Cat from Animal Syntax (2): class Cat < Animal Syntax (3): class Cat : Animal 6.10 Embedding Ring in Ring without sharing the State From Ring 1.0 we already have functions for embedding Ring in the C language. Also we can execute Ring code inside Ring programs using the eval() function. In this release we provide functions for embedding Ring in Ring programs without sharing the state. Advantages: 1. Quick integration for Ring programs and applications together without conflicts. 2. Execute and run Ring code in safe environments that we can trace. Example: pState = ring_state_init() ring_state_runcode(pState,"See 'Hello, World!'+nl") ring_state_runcode(pState,"x = 10") pState2 = ring_state_init() ring_state_runcode(pState2,"See 'Hello, World!'+nl") ring_state_runcode(pState2,"x = 20") ring_state_runcode(pState,"see x +nl") ring_state_runcode(pState2,"see x +nl") v1 = ring_state_findvar(pState,"x") v2 = ring_state_findvar(pState2,"x") see v1[3] + nl see V2[3] + nl ring_state_delete(pState) ring_state_delete(pState2) Output: Hello, World! Hello, World! 10 20 10 20 6.9. Using ‘<’ and ‘:’ operators as ‘from’ keyword 101
  • 8. Ring Documentation, Release 1.5.3 6.11 RingZip Library Ring 1.3 comes with the RingZip library for creating, modifying and extracting *.zip files. Example (1): Create myfile.zip contains 4 files load "ziplib.ring" oZip = zip_openfile("myfile.zip",'w') zip_addfile(oZip,"test.c") zip_addfile(oZip,"zip.c") zip_addfile(oZip,"zip.h") zip_addfile(oZip,"miniz.h") zip_close(oZip) Example (2): Extract myfile.zip to myfolder folder. load "ziplib.ring" zip_extract_allfiles("myfile.zip","myfolder") Example (3): Print file names in the myfile.zip load "ziplib.ring" oZip = zip_openfile("myfile.zip",'r') for x=1 to zip_filescount(oZip) see zip_getfilenamebyindex(oZip,x) + nl next zip_close(oZip) Example (4) : Using Classes instead of Functions load "ziplib.ring" new Zip { SetFileName("myfile.zip") Open("w") AddFile("test.c") AddFile("zip.c") AddFile("zip.h") AddFile("miniz.h") Close() } 6.12 Form Designer Ring 1.3 comes with the Form Designer to quickly design your GUI application windows/forms and generate the Ring source code. It’s written in Ring (Around 8000 Lines of code) using Object-Oriented Programming and Meta-Programming. We can run the From Designer from Ring Notepad 6.11. RingZip Library 102
  • 9. Ring Documentation, Release 1.5.3 Also we can run the Form Designer in another window. 6.12. Form Designer 103
  • 10. CHAPTER SEVEN WHAT IS NEW IN RING 1.2? In this chapter we will learn about the changes and new features in Ring 1.2 release. 7.1 List of changes and new features Ring 1.2 comes with many new features • New Functions • Better Functions • Better Ring Notepad • Better RingQt • Objects Library for RingQt • RingLibCurl • Better Call Command • Using NULL instead of NULLPointer() • Display Warnings Option • Better Quality 7.2 New Functions • PtrCmp() Function is a new function that compare between C pointers like the GUI objects. • PrevFileName() Function is added to return the previous active source file name. • RingVM_CFunctionsList() Function is added to return a list of functions written in C. • RingVM_FunctionsList() Function is added to return a list of functions written in Ring. • RingVM_ClassesList() Function is added to return a list of Classes. • RingVM_PackagesList() Function is added to return a list of Packages. • RingVM_MemoryList() Function is added to return a list of Memory Scopes and Variables. • RingVM_CallList() Function is added to return a list of the functions call list. • RingVM_FilesList() Function is added to return a list of the Ring Files. Example: 104