Sie sind auf Seite 1von 10

Ring Documentation, Release 1.

6. Support *.sh & *.bat extensions.


7. New Menu: Distribute

4.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

4.10. Better RingQt 43


Ring Documentation, Release 1.6

6. QRegion Class
7. QCoreApplication class

4.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

4.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

4.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.

4.11. Better StdLib 44


Ring Documentation, Release 1.6

4.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

4.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

4.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!

4.17 Using && and || operators

In Ring we have the next keywords for the logical operations

4.14. Using Tab instead of char(9) 45


Ring Documentation, Release 1.6

• 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

4.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

4.18. Using ? to print expression then new line 46


Ring Documentation, Release 1.6

? x
next

Output:
Hello, World!
1
2
3
4
5
6
7
8
9
10

4.18. Using ? to print expression then new line 47


CHAPTER

FIVE

WHAT IS NEW IN RING 1.5?

In this chapter we will learn about the changes and new features in Ring 1.5 release.

5.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

5.2 Video-Music-Player Application

The Video-Music-Player application is added to the Applications folder.


Screen Shot:

48
Ring Documentation, Release 1.6

5.3 Windows StartUp Manager Application

The Windows StartUp Manager


URL : https://github.com/ring-lang/WinStartupManager
Screen Shot:

5.3. Windows StartUp Manager Application 49


Ring Documentation, Release 1.6

5.4 Calculator Application

The Calculator application is added to the Applications folder.


Screen Shot:

5.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:

5.4. Calculator Application 50


Ring Documentation, Release 1.6

5.5. Better Ring Notepad 51


Ring Documentation, Release 1.6

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:

5.5. Better Ring Notepad 52