SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.5.2
sum([ :a = 1, :b = 2])
sum([ :a = 1 ])
sum([ :b = 2 ])
func sum pList
if plist[:a] = NULL pList[:a] = 4 ok
if plist[:b] = NULL pList[:b] = 5 ok
see pList[:a] + pList[:b] + nl
Output
3
6
6
95.30 How to print keys or values only in List/Dictionary?
If you want to print keys only or values only just select the index of the item (one or two).
Example
C_COUNTRY = 1
C_CITY = 2
mylist = [
:KSA = "Riyadh" ,
:Egypt = "Cairo"
]
for x in mylist
see x[C_COUNTRY] + nl
next
for x in mylist
see x[C_CITY] + nl
next
Output
ksa
egypt
Riyadh
Cairo
95.31 Why I get a strange result when printing nl with lists?
In the next code
list = 1:5 # list = [1,2,3,4,5]
see list + nl
New Line will be added to the list then the list will be printed, the default print of the lists will print a newline at the
end, You added new newline and You have now 2 newlines to be printed.
See <Expr>
The see command just print the final result of the expression, the expression will be evaluated as it
95.30. How to print keys or values only in List/Dictionary? 1715
Ring Documentation, Release 1.5.2
nl = char(13) + char(10) # just a variable that you can change to anything !
The + is an operator
string + string ---> new string
string + number ---> new string
number + number ---> new number
number + string ---> new number
list + item —> nothing new will be created but the item will be added to the same list
Exception
number + nl ?> New String
This exception is added to easily print numbers then new line.
No need for this with printing lists because after printing the last item we already get a new line.
95.32 Could you explain the output of the StrCmp() function?
At first remember that you can check strings using ‘=’ operator directly.
see strcmp("hello","hello") + nl +
strcmp("abc","bcd") + nl +
strcmp("bcd","abc") + nl
if the two strings are the same then it returns 0
abc and bcd aren’t the same. in the second line it returns -1 and in the third line it returns 1
In the second line we compare between “abc” and “bcd”
Not equal because the first letter in “abc” = “a” and the first letter in “bcd” = “b”
So we have “a” != “b” and “a” < “b”
So we get output = -1
In the third line we have “bcd” and “abc”
the first letter in “bcd” is “b” and the first letter in “abc” is “a”
So we have “b” != “a” and “b” > “a”
So we get output = 1
Note: ASCII(“a”) = 97 and ASCII(“b”) = 98 So “a” < “b” because 97 < 98
95.33 How to use many source code files in the project?
Example:
I have the next folder
C:LRing
Contains the next files
95.32. Could you explain the output of the StrCmp() function? 1716
Ring Documentation, Release 1.5.2
C:LRingt1.ring
C:LRingmylib.ring
C:LRinglibsmylib2.ring
The file t1.ring contains the next code
load "mylib.ring"
load "libsmylib2.ring"
myfunc()
test()
The file mylib.ring contains the next code
func myfunc
see "message from myfunc"+nl
The file libsmylib2.ring contains the next code
func test
see "message from test" + nl
from the folder C:LRing
If Ring is not added to the path you can add it or use the next command
set path=%path%;c:ringbin;
Where c:ring is the Ring folder
Now run
Ring t1.ring
Output
message from myfunc
message from test
95.34 Why this example use the GetChar() twice?
The GetChar() function accept one character from the keyboard buffer
In this example
While True
See "
Main Menu
(1) Say Hello
(2) Exit
"
Option = GetChar()
GetChar() GetChar() # End of line
# the previous two lines can be replaced with the next line
# Give Option
if Option = 1
see "Enter your name : " give cName
see "Hello " + cName
else
95.34. Why this example use the GetChar() twice? 1717
Ring Documentation, Release 1.5.2
bye
ok
End
We uses GetChar() Three times
The first time we get the user option
Option = GetChar()
But in the second and the third times (We accept the new line characters from the buffer)
GetChar() GetChar() # End of line
Example : when the user select the option number 1 then press ENTER
We have Three Characters
• The first character is : Number 1
• The second character is : CHAR(13)
• The third character is : CHAR(10)
Because Windows uses CHAR(13) and CHAR(10) for each new line ( i.e. CR+LF )
95.35 How to use NULL and ISNULL() function?
when we try to use uninitialized variable in the Ring programming language, we get a clear runtime error message
Example
See x
Output
Line 1 Error (R24) : Using uninitialized variable : x
in file testsseeuninit.ring
The same happens when you try to access uninitialized attributes
Example
o1 = new point
see o1
see o1.x
class point x y z
Output
x: NULL
y: NULL
z: NULL
Line 3 Error (R24) : Using uninitialized variable : x
in file testsseeuninit2.ring
if you want to check for the error, just use Try/Catch/End
95.35. How to use NULL and ISNULL() function? 1718
Ring Documentation, Release 1.5.2
Try
see x
Catch
See "Sorry, We can't use x!" + nl
Done
Output
Sorry, We can't use x!
Now we will talk about NULL and ISNULL()
Since we get error message when we deal with uninitialized variables
We can check these errors using Try/Catch/Done, So we uses NULL and ISNULL() for dealing with Strings.
NULL is a variable contains an empty string
ISNULL() is a function that returns true (1) if the input is an empty string or just a string contains “NULL”
This because we need to test these values (empty strings) and strings contains “NULL” that sometimes come from
external resource like DBMS.
Example
See IsNull(5) + nl + # print 0
IsNull("hello") + nl + # print 0
IsNull([1,3,5]) + nl + # print 0
IsNull("") + nl + # print 1
IsNull("NULL") # print 1
95.36 How to print lists that contains objects?
In this example we will see how we can print a list contains objects.
aList = [[1,2,3] , new point(1,2,3), new point(1,2,3)]
see "print the list" + nl
see alist
see "print the item (object)" + nl
see alist[2]
class point x y z
func init p1,p2,p3 x=p1 y=p2 z=p3
Output
print the list
1
2
3
x: 1.000000
y: 2.000000
z: 3.000000
x: 1.000000
y: 2.000000
z: 3.000000
print the item (object)
x: 1.000000
y: 2.000000
z: 3.000000
95.36. How to print lists that contains objects? 1719
Ring Documentation, Release 1.5.2
95.37 How to insert an item to the first position in the list?
To insert an item we can use the insert(aList,nIndex,Value) function.
aList = 1:5
insert(aList,0,0)
See aList # print numbers from 0 to 5
95.38 How to print new lines and other characters?
To print new line we can use the nl variable.
See "Hello" + nl
or we can use multi-line literal as in the next example
See "Hello
"
if we want to print other characters we can use the char(nASCII) function
See char(109) + nl + # print m
char(77) # print M
95.39 Why we don’t use () after the qApp class name?
When we use RingQt to create GUI application, we uses () after the class name when we create new objects for
example.
new qWidget() { setWindowTitle("Hello World") resize(400,400) show() }
but before doing that we create an object from the qApp class and we don’t use () after that
Load "guilib.ring"
app = new qApp
{
win=new qWidget()
{
setwindowtitle(:test)
show()
}
exec()
}
Using () after the class name means calling the init() method in the class and passing parameters to this method.
If we used () while no init() method in the class we get the expected error message.
The class qApp don’t have this method while the other classes have it because they need it to create an object using
a function that return a pointer to that object and this pointer will be stored in an attribute called pObject, for more
information see ring_qt.ring file which contains the classes.
95.37. How to insert an item to the first position in the list? 1720
Ring Documentation, Release 1.5.2
95.40 Why the window title bar is going outside the screen?
When we write the next code
Load "guilib.ring"
app = new qApp
{
win=new qWidget()
{
setwindowtitle(:test)
setGeometry(0,0,200,200)
show()
}
exec()
}
I would expect that the window will run at the point (0,0) with (200,200) size but the actual result is that the window
title bar is going outside the screen.
This is related to the behavior of Qt framework.
The next code will avoid the problem
load "guilib.ring"
new qApp {
new qWidget() {
move(0,0)
resize(200,200)
show()
}
exec()
}
95.41 How to create an array of buttons in GUI applications?
Check the next example:
Load "guilib.ring"
App1 = new qApp {
win1 = new qWidget() {
move(0,0)
resize(500,500)
new qPushButton(win1)
{
settext("OK")
setclickevent("click()")
}
btn1 = new qPushButton(win1)
{
setgeometry(100,100,100,30)
settext("Button1")
}
btn2 = new qPushButton(win1)
{
95.40. Why the window title bar is going outside the screen? 1721
Ring Documentation, Release 1.5.2
setgeometry(200,100,100,30)
settext("Button2")
}
button = [btn1, btn2]
show()
}
exec()
}
func click
button[1] { settext ("Button3") }
button[2] { settext ("Button4") }
95.42 How to Close a window then displaying another one?
This example demonstrates how to close a window and show another one
Load "guilib.ring"
app=new qApp
{
frmBefore=new Qwidget()
{
setWindowTitle("before!")
resize(300,320)
move(200,200)
button=new qPushButton(frmBefore)
{
setText("Close")
setClickEvent("frmBefore.close() frmMain.show()")
}
show()
}
frmMain=new Qwidget()
{
setWindowTitle("After!")
resize(300,320)
move(200,200)
}
exec()
}
95.43 How to create a Modal Window?
This example demonstrates how to create a modal window
95.42. How to Close a window then displaying another one? 1722
Ring Documentation, Release 1.5.2
load "guilib.ring"
app=new qApp
{
frmStart=new Qwidget()
{
setWindowTitle("The First Window")
resize(300,320)
move(200,200)
button=new qPushButton(frmStart)
{
setText("Show Modal Window")
resize(200,30)
setClickEvent("frmModal.show()")
}
new qPushButton(frmStart)
{
setText("Close Window")
move(0,50)
resize(200,30)
setClickEvent("frmStart.Close()")
}
show()
}
frmModal =new Qwidget()
{
setWindowTitle("Modal Window")
resize(300,320)
move(200,200)
setparent(frmStart)
setwindowmodality(true)
setwindowflags(Qt_Dialog)
}
exec()
}
Related Documents
• http://doc.qt.io/qt-5/qtwidgets-widgets-windowflags-example.html
• http://doc.qt.io/qt-5/qt.html#WindowType-enum
• http://doc.qt.io/qt-5/qwindow.html#setParent
• http://doc.qt.io/qt-5/qt.html#WindowModality-enum
95.44 How can I disable maximize button and resize window?
Use the method setWindowFlags()
Load "guilib.ring"
app1 = new qapp {
win1 = new qwidget() {
95.44. How can I disable maximize button and resize window? 1723
Ring Documentation, Release 1.5.2
setwindowtitle("First")
setgeometry(100,100,500,500)
new qpushbutton(win1) {
setgeometry(100,100,100,30)
settext("close")
setclickevent("app1.quit()")
}
new qpushbutton(win1) {
setgeometry(250,100,100,30)
settext("Second")
setclickevent("second()")
}
showmaximized()
}
exec()
}
func second
win2 = new qwidget() {
setwindowtitle("Second")
setgeometry(100,100,500,500)
setwindowflags(Qt_dialog)
show()
}
95.45 How to use SQLite using ODBC?
In Ring 1.1 and later versions we have native support for SQLite, so you don’t need to use it through ODBC.
Also we can access SQLite through RingQt.
The answer to your question
pODBC = odbc_init()
odbc_connect(pODBC,"DRIVER=SQLite3 ODBC Driver;Database=mydb.db;LongNames=0;"+
"Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;")
odbc_execute(pODBC,"create table 'tel' ('ID','NAME','PHONE');")
odbc_execute(pODBC,"insert into 'tel' values ('1','Mahmoud','123456');")
odbc_execute(pODBC,"insert into 'tel' values ('2','Ahmed','123456');")
odbc_execute(pODBC,"insert into 'tel' values ('3','Ibrahim','123456');")
odbc_execute(pODBC,"select * from tel") + nl
nMax = odbc_colcount(pODBC)
See "Columns Count : " + nMax + nl
while odbc_fetch(pODBC)
See nl
for x = 1 to nMax
see odbc_getdata(pODBC,x)
if x != nMax see " - " ok
next
end
odbc_disconnect(pODBC)
odbc_close(pODBC)
Output:
95.45. How to use SQLite using ODBC? 1724

More Related Content

What's hot

Simple IO Monad in 'Functional Programming in Scala'
Simple IO Monad in 'Functional Programming in Scala'Simple IO Monad in 'Functional Programming in Scala'
Simple IO Monad in 'Functional Programming in Scala'Philip Schwarz
 
Introducing Assignment invalidates the Substitution Model of Evaluation and v...
Introducing Assignment invalidates the Substitution Model of Evaluation and v...Introducing Assignment invalidates the Substitution Model of Evaluation and v...
Introducing Assignment invalidates the Substitution Model of Evaluation and v...Philip Schwarz
 
The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88Mahmoud Samir Fayed
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings imtiazalijoono
 
The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 9 of 84
The Ring programming language version 1.2 book - Part 9 of 84The Ring programming language version 1.2 book - Part 9 of 84
The Ring programming language version 1.2 book - Part 9 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 12 of 84
The Ring programming language version 1.2 book - Part 12 of 84The Ring programming language version 1.2 book - Part 12 of 84
The Ring programming language version 1.2 book - Part 12 of 84Mahmoud Samir Fayed
 
Monoids - Part 1 - with examples using Scalaz and Cats
Monoids - Part 1 - with examples using Scalaz and CatsMonoids - Part 1 - with examples using Scalaz and Cats
Monoids - Part 1 - with examples using Scalaz and CatsPhilip Schwarz
 
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...Philip Schwarz
 
FP 201 - Unit 6
FP 201 - Unit 6FP 201 - Unit 6
FP 201 - Unit 6rohassanie
 
Data structure lab manual
Data structure lab manualData structure lab manual
Data structure lab manualnikshaikh786
 
Abstracting over Execution with Higher Kinded Types
Abstracting over Execution with Higher Kinded TypesAbstracting over Execution with Higher Kinded Types
Abstracting over Execution with Higher Kinded TypesPhilip Schwarz
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2Amit Kapoor
 
Functional programming with haskell
Functional programming with haskellFunctional programming with haskell
Functional programming with haskellfaradjpour
 
Python lambda functions with filter, map & reduce function
Python lambda functions with filter, map & reduce functionPython lambda functions with filter, map & reduce function
Python lambda functions with filter, map & reduce functionARVIND PANDE
 

What's hot (20)

Simple IO Monad in 'Functional Programming in Scala'
Simple IO Monad in 'Functional Programming in Scala'Simple IO Monad in 'Functional Programming in Scala'
Simple IO Monad in 'Functional Programming in Scala'
 
Introducing Assignment invalidates the Substitution Model of Evaluation and v...
Introducing Assignment invalidates the Substitution Model of Evaluation and v...Introducing Assignment invalidates the Substitution Model of Evaluation and v...
Introducing Assignment invalidates the Substitution Model of Evaluation and v...
 
The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84
 
The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
 
The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84
 
The Ring programming language version 1.2 book - Part 9 of 84
The Ring programming language version 1.2 book - Part 9 of 84The Ring programming language version 1.2 book - Part 9 of 84
The Ring programming language version 1.2 book - Part 9 of 84
 
The Ring programming language version 1.2 book - Part 12 of 84
The Ring programming language version 1.2 book - Part 12 of 84The Ring programming language version 1.2 book - Part 12 of 84
The Ring programming language version 1.2 book - Part 12 of 84
 
Monoids - Part 1 - with examples using Scalaz and Cats
Monoids - Part 1 - with examples using Scalaz and CatsMonoids - Part 1 - with examples using Scalaz and Cats
Monoids - Part 1 - with examples using Scalaz and Cats
 
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...
N-Queens Combinatorial Problem - Polyglot FP for fun and profit - Haskell and...
 
Monad Fact #2
Monad Fact #2Monad Fact #2
Monad Fact #2
 
1.2 matlab numerical data
1.2  matlab numerical data1.2  matlab numerical data
1.2 matlab numerical data
 
Computer Programming- Lecture 9
Computer Programming- Lecture 9Computer Programming- Lecture 9
Computer Programming- Lecture 9
 
FP 201 - Unit 6
FP 201 - Unit 6FP 201 - Unit 6
FP 201 - Unit 6
 
Data structure lab manual
Data structure lab manualData structure lab manual
Data structure lab manual
 
Abstracting over Execution with Higher Kinded Types
Abstracting over Execution with Higher Kinded TypesAbstracting over Execution with Higher Kinded Types
Abstracting over Execution with Higher Kinded Types
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2
 
Fp201 unit4
Fp201 unit4Fp201 unit4
Fp201 unit4
 
Functional programming with haskell
Functional programming with haskellFunctional programming with haskell
Functional programming with haskell
 
Python lambda functions with filter, map & reduce function
Python lambda functions with filter, map & reduce functionPython lambda functions with filter, map & reduce function
Python lambda functions with filter, map & reduce function
 

Similar to The Ring programming language version 1.5.2 book - Part 175 of 181

The Ring programming language version 1.6 book - Part 183 of 189
The Ring programming language version 1.6 book - Part 183 of 189The Ring programming language version 1.6 book - Part 183 of 189
The Ring programming language version 1.6 book - Part 183 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 91 of 196
The Ring programming language version 1.7 book - Part 91 of 196The Ring programming language version 1.7 book - Part 91 of 196
The Ring programming language version 1.7 book - Part 91 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 175 of 180
The Ring programming language version 1.5.1 book - Part 175 of 180 The Ring programming language version 1.5.1 book - Part 175 of 180
The Ring programming language version 1.5.1 book - Part 175 of 180 Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 32 of 189
The Ring programming language version 1.6 book - Part 32 of 189The Ring programming language version 1.6 book - Part 32 of 189
The Ring programming language version 1.6 book - Part 32 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 32 of 202
The Ring programming language version 1.8 book - Part 32 of 202The Ring programming language version 1.8 book - Part 32 of 202
The Ring programming language version 1.8 book - Part 32 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 184 of 189
The Ring programming language version 1.6 book - Part 184 of 189The Ring programming language version 1.6 book - Part 184 of 189
The Ring programming language version 1.6 book - Part 184 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 21 of 181
The Ring programming language version 1.5.2 book - Part 21 of 181The Ring programming language version 1.5.2 book - Part 21 of 181
The Ring programming language version 1.5.2 book - Part 21 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 20 of 84
The Ring programming language version 1.2 book - Part 20 of 84The Ring programming language version 1.2 book - Part 20 of 84
The Ring programming language version 1.2 book - Part 20 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 31 of 212
The Ring programming language version 1.10 book - Part 31 of 212The Ring programming language version 1.10 book - Part 31 of 212
The Ring programming language version 1.10 book - Part 31 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 28 of 212
The Ring programming language version 1.10 book - Part 28 of 212The Ring programming language version 1.10 book - Part 28 of 212
The Ring programming language version 1.10 book - Part 28 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 25 of 88
The Ring programming language version 1.3 book - Part 25 of 88The Ring programming language version 1.3 book - Part 25 of 88
The Ring programming language version 1.3 book - Part 25 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 22 of 189
The Ring programming language version 1.6 book - Part 22 of 189The Ring programming language version 1.6 book - Part 22 of 189
The Ring programming language version 1.6 book - Part 22 of 189Mahmoud Samir Fayed
 

Similar to The Ring programming language version 1.5.2 book - Part 175 of 181 (20)

The Ring programming language version 1.6 book - Part 183 of 189
The Ring programming language version 1.6 book - Part 183 of 189The Ring programming language version 1.6 book - Part 183 of 189
The Ring programming language version 1.6 book - Part 183 of 189
 
The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202
 
The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194
 
The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212
 
The Ring programming language version 1.7 book - Part 91 of 196
The Ring programming language version 1.7 book - Part 91 of 196The Ring programming language version 1.7 book - Part 91 of 196
The Ring programming language version 1.7 book - Part 91 of 196
 
The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88
 
The Ring programming language version 1.5.1 book - Part 175 of 180
The Ring programming language version 1.5.1 book - Part 175 of 180 The Ring programming language version 1.5.1 book - Part 175 of 180
The Ring programming language version 1.5.1 book - Part 175 of 180
 
The Ring programming language version 1.6 book - Part 32 of 189
The Ring programming language version 1.6 book - Part 32 of 189The Ring programming language version 1.6 book - Part 32 of 189
The Ring programming language version 1.6 book - Part 32 of 189
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
The Ring programming language version 1.8 book - Part 32 of 202
The Ring programming language version 1.8 book - Part 32 of 202The Ring programming language version 1.8 book - Part 32 of 202
The Ring programming language version 1.8 book - Part 32 of 202
 
The Ring programming language version 1.6 book - Part 184 of 189
The Ring programming language version 1.6 book - Part 184 of 189The Ring programming language version 1.6 book - Part 184 of 189
The Ring programming language version 1.6 book - Part 184 of 189
 
The Ring programming language version 1.5.2 book - Part 21 of 181
The Ring programming language version 1.5.2 book - Part 21 of 181The Ring programming language version 1.5.2 book - Part 21 of 181
The Ring programming language version 1.5.2 book - Part 21 of 181
 
The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210
 
The Ring programming language version 1.2 book - Part 20 of 84
The Ring programming language version 1.2 book - Part 20 of 84The Ring programming language version 1.2 book - Part 20 of 84
The Ring programming language version 1.2 book - Part 20 of 84
 
The Ring programming language version 1.10 book - Part 31 of 212
The Ring programming language version 1.10 book - Part 31 of 212The Ring programming language version 1.10 book - Part 31 of 212
The Ring programming language version 1.10 book - Part 31 of 212
 
The Ring programming language version 1.10 book - Part 28 of 212
The Ring programming language version 1.10 book - Part 28 of 212The Ring programming language version 1.10 book - Part 28 of 212
The Ring programming language version 1.10 book - Part 28 of 212
 
The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196
 
The Ring programming language version 1.3 book - Part 25 of 88
The Ring programming language version 1.3 book - Part 25 of 88The Ring programming language version 1.3 book - Part 25 of 88
The Ring programming language version 1.3 book - Part 25 of 88
 
The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212
 
The Ring programming language version 1.6 book - Part 22 of 189
The Ring programming language version 1.6 book - Part 22 of 189The Ring programming language version 1.6 book - Part 22 of 189
The Ring programming language version 1.6 book - Part 22 of 189
 

More from Mahmoud Samir Fayed

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

More from Mahmoud Samir Fayed (20)

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

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

The Ring programming language version 1.5.2 book - Part 175 of 181

  • 1. Ring Documentation, Release 1.5.2 sum([ :a = 1, :b = 2]) sum([ :a = 1 ]) sum([ :b = 2 ]) func sum pList if plist[:a] = NULL pList[:a] = 4 ok if plist[:b] = NULL pList[:b] = 5 ok see pList[:a] + pList[:b] + nl Output 3 6 6 95.30 How to print keys or values only in List/Dictionary? If you want to print keys only or values only just select the index of the item (one or two). Example C_COUNTRY = 1 C_CITY = 2 mylist = [ :KSA = "Riyadh" , :Egypt = "Cairo" ] for x in mylist see x[C_COUNTRY] + nl next for x in mylist see x[C_CITY] + nl next Output ksa egypt Riyadh Cairo 95.31 Why I get a strange result when printing nl with lists? In the next code list = 1:5 # list = [1,2,3,4,5] see list + nl New Line will be added to the list then the list will be printed, the default print of the lists will print a newline at the end, You added new newline and You have now 2 newlines to be printed. See <Expr> The see command just print the final result of the expression, the expression will be evaluated as it 95.30. How to print keys or values only in List/Dictionary? 1715
  • 2. Ring Documentation, Release 1.5.2 nl = char(13) + char(10) # just a variable that you can change to anything ! The + is an operator string + string ---> new string string + number ---> new string number + number ---> new number number + string ---> new number list + item —> nothing new will be created but the item will be added to the same list Exception number + nl ?> New String This exception is added to easily print numbers then new line. No need for this with printing lists because after printing the last item we already get a new line. 95.32 Could you explain the output of the StrCmp() function? At first remember that you can check strings using ‘=’ operator directly. see strcmp("hello","hello") + nl + strcmp("abc","bcd") + nl + strcmp("bcd","abc") + nl if the two strings are the same then it returns 0 abc and bcd aren’t the same. in the second line it returns -1 and in the third line it returns 1 In the second line we compare between “abc” and “bcd” Not equal because the first letter in “abc” = “a” and the first letter in “bcd” = “b” So we have “a” != “b” and “a” < “b” So we get output = -1 In the third line we have “bcd” and “abc” the first letter in “bcd” is “b” and the first letter in “abc” is “a” So we have “b” != “a” and “b” > “a” So we get output = 1 Note: ASCII(“a”) = 97 and ASCII(“b”) = 98 So “a” < “b” because 97 < 98 95.33 How to use many source code files in the project? Example: I have the next folder C:LRing Contains the next files 95.32. Could you explain the output of the StrCmp() function? 1716
  • 3. Ring Documentation, Release 1.5.2 C:LRingt1.ring C:LRingmylib.ring C:LRinglibsmylib2.ring The file t1.ring contains the next code load "mylib.ring" load "libsmylib2.ring" myfunc() test() The file mylib.ring contains the next code func myfunc see "message from myfunc"+nl The file libsmylib2.ring contains the next code func test see "message from test" + nl from the folder C:LRing If Ring is not added to the path you can add it or use the next command set path=%path%;c:ringbin; Where c:ring is the Ring folder Now run Ring t1.ring Output message from myfunc message from test 95.34 Why this example use the GetChar() twice? The GetChar() function accept one character from the keyboard buffer In this example While True See " Main Menu (1) Say Hello (2) Exit " Option = GetChar() GetChar() GetChar() # End of line # the previous two lines can be replaced with the next line # Give Option if Option = 1 see "Enter your name : " give cName see "Hello " + cName else 95.34. Why this example use the GetChar() twice? 1717
  • 4. Ring Documentation, Release 1.5.2 bye ok End We uses GetChar() Three times The first time we get the user option Option = GetChar() But in the second and the third times (We accept the new line characters from the buffer) GetChar() GetChar() # End of line Example : when the user select the option number 1 then press ENTER We have Three Characters • The first character is : Number 1 • The second character is : CHAR(13) • The third character is : CHAR(10) Because Windows uses CHAR(13) and CHAR(10) for each new line ( i.e. CR+LF ) 95.35 How to use NULL and ISNULL() function? when we try to use uninitialized variable in the Ring programming language, we get a clear runtime error message Example See x Output Line 1 Error (R24) : Using uninitialized variable : x in file testsseeuninit.ring The same happens when you try to access uninitialized attributes Example o1 = new point see o1 see o1.x class point x y z Output x: NULL y: NULL z: NULL Line 3 Error (R24) : Using uninitialized variable : x in file testsseeuninit2.ring if you want to check for the error, just use Try/Catch/End 95.35. How to use NULL and ISNULL() function? 1718
  • 5. Ring Documentation, Release 1.5.2 Try see x Catch See "Sorry, We can't use x!" + nl Done Output Sorry, We can't use x! Now we will talk about NULL and ISNULL() Since we get error message when we deal with uninitialized variables We can check these errors using Try/Catch/Done, So we uses NULL and ISNULL() for dealing with Strings. NULL is a variable contains an empty string ISNULL() is a function that returns true (1) if the input is an empty string or just a string contains “NULL” This because we need to test these values (empty strings) and strings contains “NULL” that sometimes come from external resource like DBMS. Example See IsNull(5) + nl + # print 0 IsNull("hello") + nl + # print 0 IsNull([1,3,5]) + nl + # print 0 IsNull("") + nl + # print 1 IsNull("NULL") # print 1 95.36 How to print lists that contains objects? In this example we will see how we can print a list contains objects. aList = [[1,2,3] , new point(1,2,3), new point(1,2,3)] see "print the list" + nl see alist see "print the item (object)" + nl see alist[2] class point x y z func init p1,p2,p3 x=p1 y=p2 z=p3 Output print the list 1 2 3 x: 1.000000 y: 2.000000 z: 3.000000 x: 1.000000 y: 2.000000 z: 3.000000 print the item (object) x: 1.000000 y: 2.000000 z: 3.000000 95.36. How to print lists that contains objects? 1719
  • 6. Ring Documentation, Release 1.5.2 95.37 How to insert an item to the first position in the list? To insert an item we can use the insert(aList,nIndex,Value) function. aList = 1:5 insert(aList,0,0) See aList # print numbers from 0 to 5 95.38 How to print new lines and other characters? To print new line we can use the nl variable. See "Hello" + nl or we can use multi-line literal as in the next example See "Hello " if we want to print other characters we can use the char(nASCII) function See char(109) + nl + # print m char(77) # print M 95.39 Why we don’t use () after the qApp class name? When we use RingQt to create GUI application, we uses () after the class name when we create new objects for example. new qWidget() { setWindowTitle("Hello World") resize(400,400) show() } but before doing that we create an object from the qApp class and we don’t use () after that Load "guilib.ring" app = new qApp { win=new qWidget() { setwindowtitle(:test) show() } exec() } Using () after the class name means calling the init() method in the class and passing parameters to this method. If we used () while no init() method in the class we get the expected error message. The class qApp don’t have this method while the other classes have it because they need it to create an object using a function that return a pointer to that object and this pointer will be stored in an attribute called pObject, for more information see ring_qt.ring file which contains the classes. 95.37. How to insert an item to the first position in the list? 1720
  • 7. Ring Documentation, Release 1.5.2 95.40 Why the window title bar is going outside the screen? When we write the next code Load "guilib.ring" app = new qApp { win=new qWidget() { setwindowtitle(:test) setGeometry(0,0,200,200) show() } exec() } I would expect that the window will run at the point (0,0) with (200,200) size but the actual result is that the window title bar is going outside the screen. This is related to the behavior of Qt framework. The next code will avoid the problem load "guilib.ring" new qApp { new qWidget() { move(0,0) resize(200,200) show() } exec() } 95.41 How to create an array of buttons in GUI applications? Check the next example: Load "guilib.ring" App1 = new qApp { win1 = new qWidget() { move(0,0) resize(500,500) new qPushButton(win1) { settext("OK") setclickevent("click()") } btn1 = new qPushButton(win1) { setgeometry(100,100,100,30) settext("Button1") } btn2 = new qPushButton(win1) { 95.40. Why the window title bar is going outside the screen? 1721
  • 8. Ring Documentation, Release 1.5.2 setgeometry(200,100,100,30) settext("Button2") } button = [btn1, btn2] show() } exec() } func click button[1] { settext ("Button3") } button[2] { settext ("Button4") } 95.42 How to Close a window then displaying another one? This example demonstrates how to close a window and show another one Load "guilib.ring" app=new qApp { frmBefore=new Qwidget() { setWindowTitle("before!") resize(300,320) move(200,200) button=new qPushButton(frmBefore) { setText("Close") setClickEvent("frmBefore.close() frmMain.show()") } show() } frmMain=new Qwidget() { setWindowTitle("After!") resize(300,320) move(200,200) } exec() } 95.43 How to create a Modal Window? This example demonstrates how to create a modal window 95.42. How to Close a window then displaying another one? 1722
  • 9. Ring Documentation, Release 1.5.2 load "guilib.ring" app=new qApp { frmStart=new Qwidget() { setWindowTitle("The First Window") resize(300,320) move(200,200) button=new qPushButton(frmStart) { setText("Show Modal Window") resize(200,30) setClickEvent("frmModal.show()") } new qPushButton(frmStart) { setText("Close Window") move(0,50) resize(200,30) setClickEvent("frmStart.Close()") } show() } frmModal =new Qwidget() { setWindowTitle("Modal Window") resize(300,320) move(200,200) setparent(frmStart) setwindowmodality(true) setwindowflags(Qt_Dialog) } exec() } Related Documents • http://doc.qt.io/qt-5/qtwidgets-widgets-windowflags-example.html • http://doc.qt.io/qt-5/qt.html#WindowType-enum • http://doc.qt.io/qt-5/qwindow.html#setParent • http://doc.qt.io/qt-5/qt.html#WindowModality-enum 95.44 How can I disable maximize button and resize window? Use the method setWindowFlags() Load "guilib.ring" app1 = new qapp { win1 = new qwidget() { 95.44. How can I disable maximize button and resize window? 1723
  • 10. Ring Documentation, Release 1.5.2 setwindowtitle("First") setgeometry(100,100,500,500) new qpushbutton(win1) { setgeometry(100,100,100,30) settext("close") setclickevent("app1.quit()") } new qpushbutton(win1) { setgeometry(250,100,100,30) settext("Second") setclickevent("second()") } showmaximized() } exec() } func second win2 = new qwidget() { setwindowtitle("Second") setgeometry(100,100,500,500) setwindowflags(Qt_dialog) show() } 95.45 How to use SQLite using ODBC? In Ring 1.1 and later versions we have native support for SQLite, so you don’t need to use it through ODBC. Also we can access SQLite through RingQt. The answer to your question pODBC = odbc_init() odbc_connect(pODBC,"DRIVER=SQLite3 ODBC Driver;Database=mydb.db;LongNames=0;"+ "Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;") odbc_execute(pODBC,"create table 'tel' ('ID','NAME','PHONE');") odbc_execute(pODBC,"insert into 'tel' values ('1','Mahmoud','123456');") odbc_execute(pODBC,"insert into 'tel' values ('2','Ahmed','123456');") odbc_execute(pODBC,"insert into 'tel' values ('3','Ibrahim','123456');") odbc_execute(pODBC,"select * from tel") + nl nMax = odbc_colcount(pODBC) See "Columns Count : " + nMax + nl while odbc_fetch(pODBC) See nl for x = 1 to nMax see odbc_getdata(pODBC,x) if x != nMax see " - " ok next end odbc_disconnect(pODBC) odbc_close(pODBC) Output: 95.45. How to use SQLite using ODBC? 1724