SlideShare a Scribd company logo
Ring Documentation, Release 1.10
• and
• or
• not
Now we have also the next operators
• &&
• ||
• !
Example:
if one() and two()
see "Test1 - Fail" + nl
else
see "Test1 - Pass" + nl
ok
if two() or one()
see "Test2 - Pass" + nl
else
see "Test2 - Fail" + nl
ok
if one() && two()
see "Test3 - Fail" + nl
else
see "Test3 - Pass" + nl
ok
if two() || one()
see "Test4 - Pass" + nl
else
see "Test4 - Fail" + nl
ok
func one return True
func two return False
Output:
Test1 - Pass
Test2 - Pass
Test3 - Pass
Test4 - Pass
8.18 Using ? to print expression then new line
It’s common to print new line after printing an expression, We can use the ? operator to do that!
Example:
? "Hello, World!"
for x = 1 to 10
8.18. Using ? to print expression then new line 98
Ring Documentation, Release 1.10
? x
next
Output:
Hello, World!
1
2
3
4
5
6
7
8
9
10
8.18. Using ? to print expression then new line 99
CHAPTER
NINE
WHAT IS NEW IN RING 1.5?
In this chapter we will learn about the changes and new features in Ring 1.5 release.
9.1 List of changes and new features
Ring 1.5 comes with many new features!
• Video-Music-Player Application
• Windows StartUp Manager Application
• Calculator Application
• Better Ring Notepad
• Better StdLib
• Better WebLib
• Better RingQt
• Better Objects Library
• RingFreeGLUT Extension
• RingOpenGL Extension
• Better Code Generator for Extensions
• Better Documentation Generator for Extensions
• Ring VM - Tracing Functions
• Trace Library and Interactive Debugger
• More Syntax Flexibility
• Type Hints Library
• Better Quality
9.2 Video-Music-Player Application
The Video-Music-Player application is added to the Applications folder.
Screen Shot:
100
Ring Documentation, Release 1.10
9.3 Windows StartUp Manager Application
The Windows StartUp Manager
URL : https://github.com/ring-lang/WinStartupManager
Screen Shot:
9.3. Windows StartUp Manager Application 101
Ring Documentation, Release 1.10
9.4 Calculator Application
The Calculator application is added to the Applications folder.
Screen Shot:
9.5 Better Ring Notepad
1. Ring Notepad is updated to include some new styles and the Main File ToolBar
The idea of the Main File ToolBar is to determine the main file in the project When the project contains many source
code files
This way you can run the project ( Main File ) at any time while opening other files in the project without the need to
switch to the Main File to run the project.
To quickly use this feature
(Open the project main file)
Press Ctrl+Shift+M to set the current source code file as the main file
Open and modify other source code files in the project
To run the project (Main File) at any time press Ctrl+Shift+F5 (GUI) or Ctrl+Shift+D (Console)
Screen Shots:
9.4. Calculator Application 102
Ring Documentation, Release 1.10
9.5. Better Ring Notepad 103
Ring Documentation, Release 1.10
2. The output window is updated to display the new lines correctly and contains the “Clear” button.
Screen Shot:
(3) The Ring Notepad is updated to quickly open and switch between large files while preparing the functions/classes
lists in the background.
Screen Shot:
9.5. Better Ring Notepad 104
Ring Documentation, Release 1.10
9.6 Better StdLib
New Functions
• Print2Str()
• ListAllFiles()
• SystemCmd()
1. The Print2Str() is a new function added to the StdLib
Example:
load "stdlib.ring"
world = "World!"
mystring = print2str("Hello, #{world} nIn Year n#{2000+17} n")
see mystring + nl
Output:
Hello, World!
In Year
2017
2. The ListAllFiles() is a new function added to the StdLib
Using this function we can quickly do a process on a group of files in a folder and it’s sub folders.
Example:
load "stdlib.ring"
aList = ListAllFiles("c:/ring/ringlibs","ring") # *.ring only
9.6. Better StdLib 105
Ring Documentation, Release 1.10
aList = sort(aList)
see aList
Example:
load "stdlib.ring"
see listallfiles("b:/ring/ringlibs/weblib","") # All Files
3. The SystemCmd() is a new function added to the StdLib
The function will execute a system command like the System() function but will return the output in a string.
Example:
cYou = SystemCmd("whoami")
See "SystemCmd: whoami ====="+ nl + cYou +nl
Output:
SystemCmd: whoami =====
desktop-umbertoumberto
9.7 Better WebLib
The WebLib is updated to include the HTMLPage class
Using this class we can create HTML documents without printing the output to the standard output
So instead of using the WebLib in Web Applications only
We can use it in Console/GUI/Mobile Applications too
Example:
load "stdlib.ring"
load "weblib.ring"
import System.Web
func main
mypage = new HtmlPage {
h1 { text("Customers Report") }
Table
{
style = stylewidth("100%") + stylegradient(4)
TR
{
TD { WIDTH="10%" text("Customers Count : " ) }
TD { text (100) }
}
}
Table
{
style = stylewidth("100%") + stylegradient(26)
TR
{
style = stylewidth("100%") + stylegradient(24)
9.7. Better WebLib 106
Ring Documentation, Release 1.10
TD { text("Name " ) }
TD { text("Age" ) }
TD { text("Country" ) }
TD { text("Job" ) }
TD { text("Company" ) }
}
for x = 1 to 100
TR
{
TD { text("Test" ) }
TD { text("30" ) }
TD { text("Egypt" ) }
TD { text("Sales" ) }
TD { text("Future" ) }
}
next
}
}
write("report.html",mypage.output())
Using this feature we can create reports quickly using WebLib & GUILib together
Example:
load "stdlib.ring"
load "weblib.ring"
load "guilib.ring"
import System.Web
import System.GUI
new qApp {
open_window(:CustomersReportController)
exec()
}
class CustomersReportController
oView = new CustomersReportView
func Start
CreateReport()
func CreateReport
mypage = new HtmlPage {
h1 { text("Customers Report") }
Table
{
style = stylewidth("100%") + stylegradient(4)
TR
{
TD { WIDTH="10%"
text("Customers Count : " ) }
TD { text (100) }
}
}
Table
9.7. Better WebLib 107

More Related Content

What's hot (20)

PDF
Últimas atualizações de produtividade no Visual Studio 2017​
Letticia Nicoli
 
PDF
The Ring programming language version 1.10 book - Part 35 of 212
Mahmoud Samir Fayed
 
PDF
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum
 
PDF
The Ring programming language version 1.5.4 book - Part 26 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.9 book - Part 12 of 210
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.8 book - Part 10 of 202
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.2 book - Part 26 of 181
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 7 of 196
Mahmoud Samir Fayed
 
PPTX
Retrofit 2 - O que devemos saber
Bruno Vieira
 
PDF
The Ring programming language version 1.5.4 book - Part 27 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.3 book - Part 26 of 184
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.9 book - Part 34 of 210
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.3 book - Part 13 of 184
Mahmoud Samir Fayed
 
PPT
4 b file-io-if-then-else
Malik Alig
 
PDF
The Ring programming language version 1.10 book - Part 19 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 22 of 212
Mahmoud Samir Fayed
 
PPT
Test presentation impress
shoesh1neboy
 
PDF
The Ring programming language version 1.8 book - Part 31 of 202
Mahmoud Samir Fayed
 
DOCX
Client server part 12
fadlihulopi
 
PDF
The Ring programming language version 1.5.3 book - Part 25 of 184
Mahmoud Samir Fayed
 
Últimas atualizações de produtividade no Visual Studio 2017​
Letticia Nicoli
 
The Ring programming language version 1.10 book - Part 35 of 212
Mahmoud Samir Fayed
 
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum
 
The Ring programming language version 1.5.4 book - Part 26 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 12 of 210
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 10 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 26 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 7 of 196
Mahmoud Samir Fayed
 
Retrofit 2 - O que devemos saber
Bruno Vieira
 
The Ring programming language version 1.5.4 book - Part 27 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 26 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 34 of 210
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 13 of 184
Mahmoud Samir Fayed
 
4 b file-io-if-then-else
Malik Alig
 
The Ring programming language version 1.10 book - Part 19 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 22 of 212
Mahmoud Samir Fayed
 
Test presentation impress
shoesh1neboy
 
The Ring programming language version 1.8 book - Part 31 of 202
Mahmoud Samir Fayed
 
Client server part 12
fadlihulopi
 
The Ring programming language version 1.5.3 book - Part 25 of 184
Mahmoud Samir Fayed
 

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

PDF
The Ring programming language version 1.9 book - Part 13 of 210
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.1 book - Part 6 of 180
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.3 book - Part 7 of 184
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.5.4 book - Part 7 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 18 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.8 book - Part 15 of 202
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.9 book - Part 17 of 210
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 13 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.4 book - Part 3 of 30
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.4 book - Part 11 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 21 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.4 book - Part 14 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.6 book - Part 16 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.4.1 book - Part 3 of 31
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 9 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.5.2 book - Part 13 of 181
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.8 book - Part 200 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 13 of 210
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 6 of 180
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 7 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 11 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 7 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 18 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 15 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 17 of 210
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 13 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.4 book - Part 3 of 30
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 11 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 21 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 14 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 16 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.4.1 book - Part 3 of 31
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 9 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.5.2 book - Part 13 of 181
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.8 book - Part 200 of 202
Mahmoud Samir Fayed
 
Ad

More from Mahmoud Samir Fayed (20)

PDF
The Ring programming language version 1.10 book - Part 212 of 212
Mahmoud Samir Fayed
 
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
 
The Ring programming language version 1.10 book - Part 212 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
 
Ad

Recently uploaded (20)

PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Human Resources Information System (HRIS)
Amity University, Patna
 

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

  • 1. Ring Documentation, Release 1.10 • and • or • not Now we have also the next operators • && • || • ! Example: if one() and two() see "Test1 - Fail" + nl else see "Test1 - Pass" + nl ok if two() or one() see "Test2 - Pass" + nl else see "Test2 - Fail" + nl ok if one() && two() see "Test3 - Fail" + nl else see "Test3 - Pass" + nl ok if two() || one() see "Test4 - Pass" + nl else see "Test4 - Fail" + nl ok func one return True func two return False Output: Test1 - Pass Test2 - Pass Test3 - Pass Test4 - Pass 8.18 Using ? to print expression then new line It’s common to print new line after printing an expression, We can use the ? operator to do that! Example: ? "Hello, World!" for x = 1 to 10 8.18. Using ? to print expression then new line 98
  • 2. Ring Documentation, Release 1.10 ? x next Output: Hello, World! 1 2 3 4 5 6 7 8 9 10 8.18. Using ? to print expression then new line 99
  • 3. CHAPTER NINE WHAT IS NEW IN RING 1.5? In this chapter we will learn about the changes and new features in Ring 1.5 release. 9.1 List of changes and new features Ring 1.5 comes with many new features! • Video-Music-Player Application • Windows StartUp Manager Application • Calculator Application • Better Ring Notepad • Better StdLib • Better WebLib • Better RingQt • Better Objects Library • RingFreeGLUT Extension • RingOpenGL Extension • Better Code Generator for Extensions • Better Documentation Generator for Extensions • Ring VM - Tracing Functions • Trace Library and Interactive Debugger • More Syntax Flexibility • Type Hints Library • Better Quality 9.2 Video-Music-Player Application The Video-Music-Player application is added to the Applications folder. Screen Shot: 100
  • 4. Ring Documentation, Release 1.10 9.3 Windows StartUp Manager Application The Windows StartUp Manager URL : https://github.com/ring-lang/WinStartupManager Screen Shot: 9.3. Windows StartUp Manager Application 101
  • 5. Ring Documentation, Release 1.10 9.4 Calculator Application The Calculator application is added to the Applications folder. Screen Shot: 9.5 Better Ring Notepad 1. Ring Notepad is updated to include some new styles and the Main File ToolBar The idea of the Main File ToolBar is to determine the main file in the project When the project contains many source code files This way you can run the project ( Main File ) at any time while opening other files in the project without the need to switch to the Main File to run the project. To quickly use this feature (Open the project main file) Press Ctrl+Shift+M to set the current source code file as the main file Open and modify other source code files in the project To run the project (Main File) at any time press Ctrl+Shift+F5 (GUI) or Ctrl+Shift+D (Console) Screen Shots: 9.4. Calculator Application 102
  • 6. Ring Documentation, Release 1.10 9.5. Better Ring Notepad 103
  • 7. Ring Documentation, Release 1.10 2. The output window is updated to display the new lines correctly and contains the “Clear” button. Screen Shot: (3) The Ring Notepad is updated to quickly open and switch between large files while preparing the functions/classes lists in the background. Screen Shot: 9.5. Better Ring Notepad 104
  • 8. Ring Documentation, Release 1.10 9.6 Better StdLib New Functions • Print2Str() • ListAllFiles() • SystemCmd() 1. The Print2Str() is a new function added to the StdLib Example: load "stdlib.ring" world = "World!" mystring = print2str("Hello, #{world} nIn Year n#{2000+17} n") see mystring + nl Output: Hello, World! In Year 2017 2. The ListAllFiles() is a new function added to the StdLib Using this function we can quickly do a process on a group of files in a folder and it’s sub folders. Example: load "stdlib.ring" aList = ListAllFiles("c:/ring/ringlibs","ring") # *.ring only 9.6. Better StdLib 105
  • 9. Ring Documentation, Release 1.10 aList = sort(aList) see aList Example: load "stdlib.ring" see listallfiles("b:/ring/ringlibs/weblib","") # All Files 3. The SystemCmd() is a new function added to the StdLib The function will execute a system command like the System() function but will return the output in a string. Example: cYou = SystemCmd("whoami") See "SystemCmd: whoami ====="+ nl + cYou +nl Output: SystemCmd: whoami ===== desktop-umbertoumberto 9.7 Better WebLib The WebLib is updated to include the HTMLPage class Using this class we can create HTML documents without printing the output to the standard output So instead of using the WebLib in Web Applications only We can use it in Console/GUI/Mobile Applications too Example: load "stdlib.ring" load "weblib.ring" import System.Web func main mypage = new HtmlPage { h1 { text("Customers Report") } Table { style = stylewidth("100%") + stylegradient(4) TR { TD { WIDTH="10%" text("Customers Count : " ) } TD { text (100) } } } Table { style = stylewidth("100%") + stylegradient(26) TR { style = stylewidth("100%") + stylegradient(24) 9.7. Better WebLib 106
  • 10. Ring Documentation, Release 1.10 TD { text("Name " ) } TD { text("Age" ) } TD { text("Country" ) } TD { text("Job" ) } TD { text("Company" ) } } for x = 1 to 100 TR { TD { text("Test" ) } TD { text("30" ) } TD { text("Egypt" ) } TD { text("Sales" ) } TD { text("Future" ) } } next } } write("report.html",mypage.output()) Using this feature we can create reports quickly using WebLib & GUILib together Example: load "stdlib.ring" load "weblib.ring" load "guilib.ring" import System.Web import System.GUI new qApp { open_window(:CustomersReportController) exec() } class CustomersReportController oView = new CustomersReportView func Start CreateReport() func CreateReport mypage = new HtmlPage { h1 { text("Customers Report") } Table { style = stylewidth("100%") + stylegradient(4) TR { TD { WIDTH="10%" text("Customers Count : " ) } TD { text (100) } } } Table 9.7. Better WebLib 107