Vip Call Girls Noida ā”ļø Delhi ā”ļø 9999965857 No Advance 24HRS Live
Ā
The Ring programming language version 1.8 book - Part 11 of 202
1. CHAPTER
SEVEN
WHAT IS NEW IN RING 1.5?
In this chapter we will learn about the changes and new features in Ring 1.5 release.
7.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
7.2 Video-Music-Player Application
The Video-Music-Player application is added to the Applications folder.
Screen Shot:
71
2. Ring Documentation, Release 1.8
7.3 Windows StartUp Manager Application
The Windows StartUp Manager
URL : https://github.com/ring-lang/WinStartupManager
Screen Shot:
7.3. Windows StartUp Manager Application 72
3. Ring Documentation, Release 1.8
7.4 Calculator Application
The Calculator application is added to the Applications folder.
Screen Shot:
7.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 ļ¬le in the project When the project contains many source
code ļ¬les
This way you can run the project ( Main File ) at any time while opening other ļ¬les 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 ļ¬le)
Press Ctrl+Shift+M to set the current source code ļ¬le as the main ļ¬le
Open and modify other source code ļ¬les in the project
To run the project (Main File) at any time press Ctrl+Shift+F5 (GUI) or Ctrl+Shift+D (Console)
Screen Shots:
7.4. Calculator Application 73
5. Ring Documentation, Release 1.8
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 ļ¬les while preparing the functions/classes
lists in the background.
Screen Shot:
7.5. Better Ring Notepad 75
6. Ring Documentation, Release 1.8
7.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 ļ¬les in a folder and itās sub folders.
Example:
load "stdlib.ring"
aList = ListAllFiles("c:/ring/ringlibs","ring") # *.ring only
7.6. Better StdLib 76
7. Ring Documentation, Release 1.8
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
7.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)
7.7. Better WebLib 77
8. Ring Documentation, Release 1.8
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
7.7. Better WebLib 78