The Ring programming language version 1.7 book - Part 9 of 196
1. Ring Documentation, Release 1.7
6. Support *.sh & *.bat extensions.
7. New Menu: Distribute
5.10 Better RingQt
RingQt comes with the next updates
1. QAllEvents - getkeytext() Method
2. QSQLQuery - exec_2() Method
3. QDockWidget Events
4. AppFile() Function
5. IsMobile() Function
5.10. Better RingQt 52
2. Ring Documentation, Release 1.7
6. QRegion Class
7. QCoreApplication class
5.11 Better StdLib
StdLib comes with the next updates
1. Factors() function is updated (Return the output instead of printing it)
2. Palindrome() function is updated (Return the output instead of printing it)
3. Using stdlibcore.ring we can use the StdLib functions (Without Classes)
Also this is useful when developing standalone console applications
Because using stdlib.ring (functions & classes) will load libraries like RingLibCurl, RingOpenSSL, etc.
4. New Functions
• SystemSilent(cCommand) Function : Execute system commands without displaying the output.
• OSCreateOpenFolder(cFolder) : Create folder then change the current folder to this new folder
• OSCopyFolder(cParentFolder,cFolderNameToCopy) : Copy folder to the current directory
• OSDeleteFolder(cFolder) : Delete Folder
• OSCopyFile(cFileName) : Copy File to the current directory
• OSDeleteFile(cFileName) : Delete File
• OSRenameFile(cOldFileName,cNewFileName) : Rename file
5.12 Better RingVM
RingVM comes with the next updates
1. Support using many getter methods in Expressions
2. Support using this & self in setter/getter/normal methods without calling setter/getter methods.
3. TempName() function is updated (Better Code)
4. ExeFileName() function is updated (Better Code)
5. Private Attributes - Support re-usage in the class region (After the keyword private)
6. Ring API : ring_scanner_runobjstring()
7. ring_state_setvar() function
5.13 Better RingREPL
RingREPL comes with the next updates
1. RingREPL will get command line parameters to determine the style.
2. Setting RingREPL Style based on Ring Notepad Style.
5.11. Better StdLib 53
3. Ring Documentation, Release 1.7
5.14 Using Tab instead of char(9)
The variable Tab is defined to be used instead of char(9)
Example (1):
see :one + nl + tab + :two + nl + tab + tab + :three
Output:
one
two
three
You can change the variable to another value
Example (2):
tab = " "
see :one + nl + tab + :two + nl + tab + tab + :three
Output:
one
two
three
5.15 Using CR as Carriage return
The next example count from 1 to 10 in the same line during 10 seconds
load "stdlibcore.ring"
for x = 1 to 10 see x sleep(1) see cr next
5.16 Using the ! operator as not
We have = and != in the Ring language
But for the logical operators we have and, or & not
Now we can use the ! operator as not
Example:
if ! false
see "True!" + nl
ok
Output
True!
5.17 Using && and || operators
In Ring we have the next keywords for the logical operations
5.14. Using Tab instead of char(9) 54
4. Ring Documentation, Release 1.7
• 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
5.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
5.18. Using ? to print expression then new line 55
5. Ring Documentation, Release 1.7
? x
next
Output:
Hello, World!
1
2
3
4
5
6
7
8
9
10
5.18. Using ? to print expression then new line 56
6. CHAPTER
SIX
WHAT IS NEW IN RING 1.5?
In this chapter we will learn about the changes and new features in Ring 1.5 release.
6.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
6.2 Video-Music-Player Application
The Video-Music-Player application is added to the Applications folder.
Screen Shot:
57
7. Ring Documentation, Release 1.7
6.3 Windows StartUp Manager Application
The Windows StartUp Manager
URL : https://github.com/ring-lang/WinStartupManager
Screen Shot:
6.3. Windows StartUp Manager Application 58
8. Ring Documentation, Release 1.7
6.4 Calculator Application
The Calculator application is added to the Applications folder.
Screen Shot:
6.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:
6.4. Calculator Application 59
10. Ring Documentation, Release 1.7
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:
6.5. Better Ring Notepad 61