SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.3
52.9 Entering Items
For some controls like the List Widget we can enter items separated by comma ā€˜,ā€™
52.10 Using Layouts
1. To use layouts, At ļ¬rst add the layout control to the window.
2. Use the window ā€œSet Layoutā€ property to determine the main layout.
3. From the layout properties determine the controls and the layout type.
52.11 More Samples and Tests
Check the folder : ring/applications/formdesigner/tests
Online : https://github.com/ring-lang/ring/tree/master/applications/formdesigner/tests
52.9. Entering Items 518
CHAPTER
FIFTYTHREE
SCOPE RULES FOR VARIABLES AND ATTRIBUTES
In this chapter we will learn about scope rules and how Ring ļ¬nd variables.
Also we will learn about conļ¬‚icts and how to solve/avoid them.
The next information are important once you start developing large applications using Ring
These application may uses
ā€¢ Global variables (Try to avoid them)
ā€¢ Classes (Object-Oriented)
ā€¢ braces { } to access objects
ā€¢ Declarative Programming
ā€¢ Natural Programming
53.1 Three Scopes
In Ring we have three scopes :-
1. Public/Global Scope - Each variable you deļ¬ne in the statements part (before functions and classes)
2. Object Scope - When you are inside an object (Inside class method or using { } to access the object )
3. Local Scope - Related to functions and methods
53.2 Deļ¬ning Variables and Variables Access
1. Ring uses lexical scoping, i.e. the scope of the variable is based on where we deļ¬ned the variable.
2. Inside braces { } when you access an object, You will change the current active object scope to this object scope
but you still can access the global scope and the local scope.
3. After the ā€˜Classā€™ keyword and the class name, when you write variable names to be deļ¬ned as attributes, You
still can access the global scope.
In this region (class region - after the class name and before methods) we have
ā€¢ Global Scope ā€”-> The Global Scope
ā€¢ Object Scope ā€”-> The Object Scope
ā€¢ Local Scope ā€”-> The Object Scope
519
Ring Documentation, Release 1.3
Note: Since the local scope in the class region point also to the object scope in this region, we can use nested braces
and still have access to the object scope of the class through the local scope.
Tip: You can create windows and controls as attibutes by deļ¬ning them in this region.
Tip: In the class region if you created objects and used braces {} to access them then using self.attribute inside braces
will use the class (not the object that you access) because you have access to the class through the local scope.
4. Function Parameters are automatically deļ¬ned in the local scope.
53.3 How Ring ļ¬nd the variable?
1 - Search First in the Local Scope
if not found !
2 - Search in the Object Scope
if not found !
3 - Search in the public scope
if not found ā€”-> Runtime Error
if found ā€”-> Check if we can do optimization to avoid searching next time (Cache / Pointers for performance).
53.4 Using Object.Attribute
When we use object.attribute the search will be in the object attributes only.
I.e. no search will be done in the local scope or in the global scope for the object attribute.
Note: Using self.attribute will search for the ļ¬rst self before searching for attributes.
53.5 The Self Object
The self object is a reference to the current object that we can use from the class methods.
When we are inside class method and use Self we mean the object that will be created from this class.
Inside the class methods if we used Braces { } this will change the current object scope and self will be changed also
inside braces to reference the object that we access using Braces.
Inside the Class Region (after the class name and before any method) we have access to the object through the object
scope and the local scope also. In this region using Self will always be a reference to the class object. if we used
Braces to change the object scope then used Self inside Braces, Also self will be a reference to the class object (not
the object that we already access using braces) because in the class region we have :-
ā€¢ Global Scope ā€”> Global Scope
ā€¢ Object Scope ā€”> Object Scope
53.3. How Ring ļ¬nd the variable? 520
Ring Documentation, Release 1.3
ā€¢ Local Scope ā€”> Object Scope
And using Braces changes the object scope only (not the local scope) and when Ring search for variables it will search
in the Local Scope ļ¬rst so it will ļ¬nd self in the class that we are inside.
53.6 How Ring Deļ¬ne Variables and Attributes
Ring will use the variable name in the Assignment operation
1 - Search using the variable name
2 - If not found ā€”> Avoid the runtime error and deļ¬ne the variable in the current scope
3 - If found ā€”> Use the variable and donā€™t deļ¬ne anything in the current scope
ā€¢ In the global region (before any function or class) the current scope is the global scope.
ā€¢ In the class region (after the class name and before any method) the current scope is the object attributes.
ā€¢ In Functions and methods the current scope is the local scope.
53.7 Conļ¬‚ict between Global Variables and Class Attributes
Look at this example:
name = "test"
o1 = new person
see o1
class person
name
address
phone
In the previous example we have a global variable called ā€˜nameā€™ inside the class person.
when we use the variable ā€˜nameā€™, Ring will start the search operation and will try to ļ¬nd it.
if found ā€”> Use it
if not found ā€”> Deļ¬ne new attribute
But the variable name is a global variable, so it will be found and used!
We will not have the attribute name! added to the object.
Solution (1) - Use the Main Function
func main
name = "test"
o1 = new person
see o1
class person
name
address
phone
Solution (2) - Use special mark for global variable names like $
53.6. How Ring Deļ¬ne Variables and Attributes 521
Ring Documentation, Release 1.3
$name = "test"
o1 = new person
see o1
class person
name
address
phone
Solution (3) - Use the AddAttribute() Method
name = "test"
o1 = new person
see o1
class person
AddAttribute(self,"name")
address
phone
Solution (4) - Use self before the attribute name
name = "test"
o1 = new person
see o1
class person
self.name
address
phone
So what is the best solution to this conļ¬‚ict?
1 - Use the $ Mark for global variables
2 - Optional : Try to avoid global variables and use the Main function
In practice i do both of them.
The other solution
ā€¢ Use self before the attribute name or use AddAttribute()
53.8 Conļ¬‚ict between Class Attributes and Local Variables
This conļ¬‚ict may happen when we access the object using braces
Example:
func main
name = "nice"
o1 = new person {name="mahmoud" address="Egypt" phone = 000 }
see o1
class person
name
address
phone
53.8. Conļ¬‚ict between Class Attributes and Local Variables 522
Ring Documentation, Release 1.3
In the previous example we have the local variable name.
The value of this variable will be set to ā€œmahmoudā€ instead of the object attribute.
Solution (1) : Just use Self
func main
name = "nice"
o1 = new person {self.name="mahmoud" address="Egypt" phone = 000 }
see o1
class person
name
address
phone
Solution (2) : Change the Local variable name
func main
cName = "nice"
o1 = new person {name="mahmoud" address="Egypt" phone = 000 }
see o1
class person
name
address
phone
Solution (3) : Change Braces and use the Dot operator
func main
name = "nice"
o1 = new person
o1.name ="mahmoud"
o1.address ="Egypt"
o1.phone = 000
see o1
class person
name
address
phone
53.9 Using Braces to access objects inside Class Methods
Remember that we have Three scopes (Local Scope, Object Scope and Global Scope) and when we are inside a class
method, we expect that we have access to the object attributes and methods and this is true until we use braces to
access another object attributes and methods because in this case our object scope will be switched to another object.
new point { test() }
class point
x=10 y=20
func test
see x + nl + y + nl # works fine
myobj = new otherclass {
see name + nl
see x + nl + y + nl # error !
53.9. Using Braces to access objects inside Class Methods 523
Ring Documentation, Release 1.3
}
class otherclass
name = "test"
Output:
10
20
test
Line 8 Error (R24) : Using uninitialized variable : x
In method test() in file methodbraceerror.ring
called from line 5 in file methodbraceerror.ring
Now what we will do to solve the previous problem?
Solution (1) : Write the code that access the class attributes outside braces.
new point { test() }
class point
x=10 y=20
func test
see x + nl + y + nl # works fine
myobj = new otherclass {
see name + nl
}
see x + nl + y + nl # Outside braces - works fine
class otherclass
name = "test"
Output:
10
20
test
10
20
Solution (2) : Donā€™t Use Braces
new point { test() }
class point
x=10 y=20
func test
see x + nl + y + nl
myobj = new otherclass
see myobj.name
see x + nl + y + nl
class otherclass
name = "test"
Solution (3) : Copy the self object
We may use this solution if we want to use braces and get access to the class attributes (Just Reading).
53.9. Using Braces to access objects inside Class Methods 524
Ring Documentation, Release 1.3
new point { test() }
class point
x=10 y=20
func test
oSelf = self
see x + nl + y + nl
myobj = new otherclass {
see name + nl
see oself.x + nl + oself.y + nl
}
class otherclass
name = "test"
Output:
10
20
test
10
20
Now look at this line
oself = self
The problem with the previous line is that we will have a new copy from the object Because in Ring the assignment
operator copy lists and objects by value (not by reference).
When we access the new object attributes (reading) we donā€™t have problems
But if we modiļ¬ed the object attributes (Then we will modify the copy!).
Note: We can use braces again with the copy
new point { test() }
class point
x=10 y=20
func test
oSelf = self
see x + nl + y + nl
myobj = new otherclass {
see name + nl
oSelf {
see x + nl + y + nl
}
}
class otherclass
name = "test"
In a GUI application, we may create a class contains the window objects as attributes to be able to access the controls
from different methods. Remember the previous information when you try to access objects using braces inside
methods because in this case you canā€™t access the object attributes directly and if you copied the self object you will
work on a copy and the new controls that you create will be related to the copy and you canā€™t access them.
53.9. Using Braces to access objects inside Class Methods 525
Ring Documentation, Release 1.3
53.10 Accessing the class attributes from braces inside class meth-
ods
We access the class attributes directly from the class methods, also we have the choice to use the Self reference before
the attribute/method name. Using Braces {} inside class method change the active object scope and prevent us from
getting direct access to the class attributes. Also using Self will not help because the Self reference will be changed to
the object that we access using Braces.
In this case if you want to read an attribute you have to copy the Self object before using Braces and if you want to
modify an attribute you have to the copy from local variable to the object attribute after using Braces.
This case happens when you want to read/modify attribute insead braces.
Class MyApp
oCon # Attribute
# some code here
Func OpenDatabase
# some code here
new QSqlDatabase() {
oCon = addDatabase("QSQLITE") {
setDatabaseName("weighthistory.db")
open()
}
}
self.oCon = oCon
# some code here
In the previous example we want to create the connection object and save it inside the oCon attribute.
The object is an output from the addDatabase() method that we use after accessing the QSQLDatabase() object.
Inside braces we canā€™t use the Self reference to use the object created from the MyApp class, Because the Self reference
here will be to the object that we access using Braces.
We solved the problem in the previous example by creating a local variable called oCon then after Braces we copied
that variable to the oCon attribute.
The next code is another solution.
Class MyApp
oCon # Attribute
# some code here
Func OpenDatabase
# some code here
oCon = new QSqlDatabase()
oCon = oCon.addDatabase("QSQLITE") {
setDatabaseName("weighthistory.db")
Open()
}
# some code here
The next code is a better solution.
53.10. Accessing the class attributes from braces inside class methods 526
Ring Documentation, Release 1.3
Class MyApp
oCon # Attribute
# some code here
Func OpenDatabase
# some code here
new QSqlDatabase() {
this.oCon = addDatabase("QSQLITE") {
setDatabaseName("weighthistory.db")
Open()
}
}
# some code here
Note: We used this.attribute to access the class attribute (oCon) while we are inside Braces.
53.11 Creating a Class for each Window in GUI applications
A good way for creating classes for windows is to deļ¬ne the window directly after the class name
In this area you can use nested braces without problems to deļ¬ne the window and the controls, and they will be
attributes that you can access from methods.
Example:
Load "guilib.ring"
new qApp
{
$ObjectName = "oFirstWindow"
oFirstWindow = new FirstWindow
$ObjectName = "oSecondWindow"
oSecondWindow = new SecondWindow
exec()
}
Class FirstWindow
win = new qWidget() {
setgeometry(0,50,300,200)
setWindowTitle("First Window")
label1 = new qLabel(win)
{
setgeometry(10,10,300,30)
setText("0")
}
btn1 = new qPushButton(win)
{
move(100,100)
setText("Increment")
setClickEvent($ObjectName+".increment()")
}
53.11. Creating a Class for each Window in GUI applications 527

More Related Content

What's hot

The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.4 book - Part 20 of 30
The Ring programming language version 1.4 book - Part 20 of 30The Ring programming language version 1.4 book - Part 20 of 30
The Ring programming language version 1.4 book - Part 20 of 30Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 86 of 212
The Ring programming language version 1.10 book - Part 86 of 212The Ring programming language version 1.10 book - Part 86 of 212
The Ring programming language version 1.10 book - Part 86 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.3 book - Part 56 of 88
The Ring programming language version 1.3 book - Part 56 of 88The Ring programming language version 1.3 book - Part 56 of 88
The Ring programming language version 1.3 book - Part 56 of 88Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.2 book - Part 70 of 181
The Ring programming language version 1.5.2 book - Part 70 of 181The Ring programming language version 1.5.2 book - Part 70 of 181
The Ring programming language version 1.5.2 book - Part 70 of 181Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.1 book - Part 70 of 180
The Ring programming language version 1.5.1 book - Part 70 of 180The Ring programming language version 1.5.1 book - Part 70 of 180
The Ring programming language version 1.5.1 book - Part 70 of 180Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.4 book - Part 72 of 185
The Ring programming language version 1.5.4 book - Part 72 of 185The Ring programming language version 1.5.4 book - Part 72 of 185
The Ring programming language version 1.5.4 book - Part 72 of 185Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.8 book - Part 79 of 202
The Ring programming language version 1.8 book - Part 79 of 202The Ring programming language version 1.8 book - Part 79 of 202
The Ring programming language version 1.8 book - Part 79 of 202Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.9 book - Part 84 of 210
The Ring programming language version 1.9 book - Part 84 of 210The Ring programming language version 1.9 book - Part 84 of 210
The Ring programming language version 1.9 book - Part 84 of 210Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.4 book - Part 73 of 185
The Ring programming language version 1.5.4 book - Part 73 of 185The Ring programming language version 1.5.4 book - Part 73 of 185
The Ring programming language version 1.5.4 book - Part 73 of 185Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.8 book - Part 81 of 202
The Ring programming language version 1.8 book - Part 81 of 202The Ring programming language version 1.8 book - Part 81 of 202
The Ring programming language version 1.8 book - Part 81 of 202Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.2 book - Part 69 of 181
The Ring programming language version 1.5.2 book - Part 69 of 181The Ring programming language version 1.5.2 book - Part 69 of 181
The Ring programming language version 1.5.2 book - Part 69 of 181Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.9 book - Part 83 of 210
The Ring programming language version 1.9 book - Part 83 of 210The Ring programming language version 1.9 book - Part 83 of 210
The Ring programming language version 1.9 book - Part 83 of 210Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.2 book - Part 71 of 181
The Ring programming language version 1.5.2 book - Part 71 of 181The Ring programming language version 1.5.2 book - Part 71 of 181
The Ring programming language version 1.5.2 book - Part 71 of 181Mahmoud Samir Fayed
Ā 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5Abdii Rashid
Ā 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshowilias ahmed
Ā 
Lect 1-java object-classes
Lect 1-java object-classesLect 1-java object-classes
Lect 1-java object-classesFajar Baskoro
Ā 
ITFT-Classes and object in java
ITFT-Classes and object in javaITFT-Classes and object in java
ITFT-Classes and object in javaAtul Sehdev
Ā 
Java chapter 4
Java chapter 4Java chapter 4
Java chapter 4Abdii Rashid
Ā 

What's hot (20)

The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196
Ā 
The Ring programming language version 1.4 book - Part 20 of 30
The Ring programming language version 1.4 book - Part 20 of 30The Ring programming language version 1.4 book - Part 20 of 30
The Ring programming language version 1.4 book - Part 20 of 30
Ā 
The Ring programming language version 1.10 book - Part 86 of 212
The Ring programming language version 1.10 book - Part 86 of 212The Ring programming language version 1.10 book - Part 86 of 212
The Ring programming language version 1.10 book - Part 86 of 212
Ā 
The Ring programming language version 1.3 book - Part 56 of 88
The Ring programming language version 1.3 book - Part 56 of 88The Ring programming language version 1.3 book - Part 56 of 88
The Ring programming language version 1.3 book - Part 56 of 88
Ā 
The Ring programming language version 1.5.2 book - Part 70 of 181
The Ring programming language version 1.5.2 book - Part 70 of 181The Ring programming language version 1.5.2 book - Part 70 of 181
The Ring programming language version 1.5.2 book - Part 70 of 181
Ā 
The Ring programming language version 1.5.1 book - Part 70 of 180
The Ring programming language version 1.5.1 book - Part 70 of 180The Ring programming language version 1.5.1 book - Part 70 of 180
The Ring programming language version 1.5.1 book - Part 70 of 180
Ā 
The Ring programming language version 1.5.4 book - Part 72 of 185
The Ring programming language version 1.5.4 book - Part 72 of 185The Ring programming language version 1.5.4 book - Part 72 of 185
The Ring programming language version 1.5.4 book - Part 72 of 185
Ā 
The Ring programming language version 1.8 book - Part 79 of 202
The Ring programming language version 1.8 book - Part 79 of 202The Ring programming language version 1.8 book - Part 79 of 202
The Ring programming language version 1.8 book - Part 79 of 202
Ā 
The Ring programming language version 1.9 book - Part 84 of 210
The Ring programming language version 1.9 book - Part 84 of 210The Ring programming language version 1.9 book - Part 84 of 210
The Ring programming language version 1.9 book - Part 84 of 210
Ā 
The Ring programming language version 1.5.4 book - Part 73 of 185
The Ring programming language version 1.5.4 book - Part 73 of 185The Ring programming language version 1.5.4 book - Part 73 of 185
The Ring programming language version 1.5.4 book - Part 73 of 185
Ā 
The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210
Ā 
The Ring programming language version 1.8 book - Part 81 of 202
The Ring programming language version 1.8 book - Part 81 of 202The Ring programming language version 1.8 book - Part 81 of 202
The Ring programming language version 1.8 book - Part 81 of 202
Ā 
The Ring programming language version 1.5.2 book - Part 69 of 181
The Ring programming language version 1.5.2 book - Part 69 of 181The Ring programming language version 1.5.2 book - Part 69 of 181
The Ring programming language version 1.5.2 book - Part 69 of 181
Ā 
The Ring programming language version 1.9 book - Part 83 of 210
The Ring programming language version 1.9 book - Part 83 of 210The Ring programming language version 1.9 book - Part 83 of 210
The Ring programming language version 1.9 book - Part 83 of 210
Ā 
The Ring programming language version 1.5.2 book - Part 71 of 181
The Ring programming language version 1.5.2 book - Part 71 of 181The Ring programming language version 1.5.2 book - Part 71 of 181
The Ring programming language version 1.5.2 book - Part 71 of 181
Ā 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
Ā 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshow
Ā 
Lect 1-java object-classes
Lect 1-java object-classesLect 1-java object-classes
Lect 1-java object-classes
Ā 
ITFT-Classes and object in java
ITFT-Classes and object in javaITFT-Classes and object in java
ITFT-Classes and object in java
Ā 
Java chapter 4
Java chapter 4Java chapter 4
Java chapter 4
Ā 

Similar to The Ring programming language version 1.3 book - Part 55 of 88

The Ring programming language version 1.6 book - Part 76 of 189
The Ring programming language version 1.6 book - Part 76 of 189The Ring programming language version 1.6 book - Part 76 of 189
The Ring programming language version 1.6 book - Part 76 of 189Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.8 book - Part 80 of 202
The Ring programming language version 1.8 book - Part 80 of 202The Ring programming language version 1.8 book - Part 80 of 202
The Ring programming language version 1.8 book - Part 80 of 202Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.1 book - Part 68 of 180
The Ring programming language version 1.5.1 book - Part 68 of 180The Ring programming language version 1.5.1 book - Part 68 of 180
The Ring programming language version 1.5.1 book - Part 68 of 180Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.9 book - Part 98 of 210
The Ring programming language version 1.9 book - Part 98 of 210The Ring programming language version 1.9 book - Part 98 of 210
The Ring programming language version 1.9 book - Part 98 of 210Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.3 book - Part 83 of 184
The Ring programming language version 1.5.3 book - Part 83 of 184The Ring programming language version 1.5.3 book - Part 83 of 184
The Ring programming language version 1.5.3 book - Part 83 of 184Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.4.1 book - Part 29 of 31
The Ring programming language version 1.4.1 book - Part 29 of 31The Ring programming language version 1.4.1 book - Part 29 of 31
The Ring programming language version 1.4.1 book - Part 29 of 31Mahmoud Samir Fayed
Ā 
Module 3 Class and Object.ppt
Module 3 Class and Object.pptModule 3 Class and Object.ppt
Module 3 Class and Object.pptRanjithKumar742256
Ā 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objectsPraveen M Jigajinni
Ā 
The Ring programming language version 1.5.1 book - Part 174 of 180
The Ring programming language version 1.5.1 book - Part 174 of 180 The Ring programming language version 1.5.1 book - Part 174 of 180
The Ring programming language version 1.5.1 book - Part 174 of 180 Mahmoud Samir Fayed
Ā 
Lecture 4
Lecture 4Lecture 4
Lecture 4talha ijaz
Ā 
Ch-2ppt.pptx
Ch-2ppt.pptxCh-2ppt.pptx
Ch-2ppt.pptxssuser8347a1
Ā 
The Ring programming language version 1.5.3 book - Part 187 of 194
The Ring programming language version 1.5.3 book - Part 187 of 194The Ring programming language version 1.5.3 book - Part 187 of 194
The Ring programming language version 1.5.3 book - Part 187 of 194Mahmoud Samir Fayed
Ā 
packages and interfaces
packages and interfacespackages and interfaces
packages and interfacesmadhavi patil
Ā 

Similar to The Ring programming language version 1.3 book - Part 55 of 88 (16)

The Ring programming language version 1.6 book - Part 76 of 189
The Ring programming language version 1.6 book - Part 76 of 189The Ring programming language version 1.6 book - Part 76 of 189
The Ring programming language version 1.6 book - Part 76 of 189
Ā 
The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185
Ā 
The Ring programming language version 1.8 book - Part 80 of 202
The Ring programming language version 1.8 book - Part 80 of 202The Ring programming language version 1.8 book - Part 80 of 202
The Ring programming language version 1.8 book - Part 80 of 202
Ā 
The Ring programming language version 1.5.1 book - Part 68 of 180
The Ring programming language version 1.5.1 book - Part 68 of 180The Ring programming language version 1.5.1 book - Part 68 of 180
The Ring programming language version 1.5.1 book - Part 68 of 180
Ā 
The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84
Ā 
The Ring programming language version 1.9 book - Part 98 of 210
The Ring programming language version 1.9 book - Part 98 of 210The Ring programming language version 1.9 book - Part 98 of 210
The Ring programming language version 1.9 book - Part 98 of 210
Ā 
The Ring programming language version 1.5.3 book - Part 83 of 184
The Ring programming language version 1.5.3 book - Part 83 of 184The Ring programming language version 1.5.3 book - Part 83 of 184
The Ring programming language version 1.5.3 book - Part 83 of 184
Ā 
The Ring programming language version 1.4.1 book - Part 29 of 31
The Ring programming language version 1.4.1 book - Part 29 of 31The Ring programming language version 1.4.1 book - Part 29 of 31
The Ring programming language version 1.4.1 book - Part 29 of 31
Ā 
Module 3 Class and Object.ppt
Module 3 Class and Object.pptModule 3 Class and Object.ppt
Module 3 Class and Object.ppt
Ā 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objects
Ā 
The Ring programming language version 1.5.1 book - Part 174 of 180
The Ring programming language version 1.5.1 book - Part 174 of 180 The Ring programming language version 1.5.1 book - Part 174 of 180
The Ring programming language version 1.5.1 book - Part 174 of 180
Ā 
Lecture 4
Lecture 4Lecture 4
Lecture 4
Ā 
Ch-2ppt.pptx
Ch-2ppt.pptxCh-2ppt.pptx
Ch-2ppt.pptx
Ā 
The Ring programming language version 1.5.3 book - Part 187 of 194
The Ring programming language version 1.5.3 book - Part 187 of 194The Ring programming language version 1.5.3 book - Part 187 of 194
The Ring programming language version 1.5.3 book - Part 187 of 194
Ā 
Lecture 5.pptx
Lecture 5.pptxLecture 5.pptx
Lecture 5.pptx
Ā 
packages and interfaces
packages and interfacespackages and interfaces
packages and interfaces
Ā 

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

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
Ā 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
Ā 
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
Ā 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
Ā 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
Ā 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
Ā 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
Ā 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
Ā 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
Ā 
Transcript: #StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024BookNet Canada
Ā 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
Ā 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
Ā 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
Ā 
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
Ā 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
Ā 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
Ā 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
Ā 
#StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024BookNet Canada
Ā 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
Ā 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
Ā 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Ā 
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
Ā 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
Ā 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Ā 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
Ā 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Ā 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Ā 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Ā 
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort ServiceHot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Ā 
Transcript: #StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024
Ā 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Ā 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
Ā 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Ā 
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
Ā 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Ā 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
Ā 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
Ā 
#StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: Whatā€™s new for BISAC - Tech Forum 2024
Ā 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
Ā 

The Ring programming language version 1.3 book - Part 55 of 88

  • 1. Ring Documentation, Release 1.3 52.9 Entering Items For some controls like the List Widget we can enter items separated by comma ā€˜,ā€™ 52.10 Using Layouts 1. To use layouts, At ļ¬rst add the layout control to the window. 2. Use the window ā€œSet Layoutā€ property to determine the main layout. 3. From the layout properties determine the controls and the layout type. 52.11 More Samples and Tests Check the folder : ring/applications/formdesigner/tests Online : https://github.com/ring-lang/ring/tree/master/applications/formdesigner/tests 52.9. Entering Items 518
  • 2. CHAPTER FIFTYTHREE SCOPE RULES FOR VARIABLES AND ATTRIBUTES In this chapter we will learn about scope rules and how Ring ļ¬nd variables. Also we will learn about conļ¬‚icts and how to solve/avoid them. The next information are important once you start developing large applications using Ring These application may uses ā€¢ Global variables (Try to avoid them) ā€¢ Classes (Object-Oriented) ā€¢ braces { } to access objects ā€¢ Declarative Programming ā€¢ Natural Programming 53.1 Three Scopes In Ring we have three scopes :- 1. Public/Global Scope - Each variable you deļ¬ne in the statements part (before functions and classes) 2. Object Scope - When you are inside an object (Inside class method or using { } to access the object ) 3. Local Scope - Related to functions and methods 53.2 Deļ¬ning Variables and Variables Access 1. Ring uses lexical scoping, i.e. the scope of the variable is based on where we deļ¬ned the variable. 2. Inside braces { } when you access an object, You will change the current active object scope to this object scope but you still can access the global scope and the local scope. 3. After the ā€˜Classā€™ keyword and the class name, when you write variable names to be deļ¬ned as attributes, You still can access the global scope. In this region (class region - after the class name and before methods) we have ā€¢ Global Scope ā€”-> The Global Scope ā€¢ Object Scope ā€”-> The Object Scope ā€¢ Local Scope ā€”-> The Object Scope 519
  • 3. Ring Documentation, Release 1.3 Note: Since the local scope in the class region point also to the object scope in this region, we can use nested braces and still have access to the object scope of the class through the local scope. Tip: You can create windows and controls as attibutes by deļ¬ning them in this region. Tip: In the class region if you created objects and used braces {} to access them then using self.attribute inside braces will use the class (not the object that you access) because you have access to the class through the local scope. 4. Function Parameters are automatically deļ¬ned in the local scope. 53.3 How Ring ļ¬nd the variable? 1 - Search First in the Local Scope if not found ! 2 - Search in the Object Scope if not found ! 3 - Search in the public scope if not found ā€”-> Runtime Error if found ā€”-> Check if we can do optimization to avoid searching next time (Cache / Pointers for performance). 53.4 Using Object.Attribute When we use object.attribute the search will be in the object attributes only. I.e. no search will be done in the local scope or in the global scope for the object attribute. Note: Using self.attribute will search for the ļ¬rst self before searching for attributes. 53.5 The Self Object The self object is a reference to the current object that we can use from the class methods. When we are inside class method and use Self we mean the object that will be created from this class. Inside the class methods if we used Braces { } this will change the current object scope and self will be changed also inside braces to reference the object that we access using Braces. Inside the Class Region (after the class name and before any method) we have access to the object through the object scope and the local scope also. In this region using Self will always be a reference to the class object. if we used Braces to change the object scope then used Self inside Braces, Also self will be a reference to the class object (not the object that we already access using braces) because in the class region we have :- ā€¢ Global Scope ā€”> Global Scope ā€¢ Object Scope ā€”> Object Scope 53.3. How Ring ļ¬nd the variable? 520
  • 4. Ring Documentation, Release 1.3 ā€¢ Local Scope ā€”> Object Scope And using Braces changes the object scope only (not the local scope) and when Ring search for variables it will search in the Local Scope ļ¬rst so it will ļ¬nd self in the class that we are inside. 53.6 How Ring Deļ¬ne Variables and Attributes Ring will use the variable name in the Assignment operation 1 - Search using the variable name 2 - If not found ā€”> Avoid the runtime error and deļ¬ne the variable in the current scope 3 - If found ā€”> Use the variable and donā€™t deļ¬ne anything in the current scope ā€¢ In the global region (before any function or class) the current scope is the global scope. ā€¢ In the class region (after the class name and before any method) the current scope is the object attributes. ā€¢ In Functions and methods the current scope is the local scope. 53.7 Conļ¬‚ict between Global Variables and Class Attributes Look at this example: name = "test" o1 = new person see o1 class person name address phone In the previous example we have a global variable called ā€˜nameā€™ inside the class person. when we use the variable ā€˜nameā€™, Ring will start the search operation and will try to ļ¬nd it. if found ā€”> Use it if not found ā€”> Deļ¬ne new attribute But the variable name is a global variable, so it will be found and used! We will not have the attribute name! added to the object. Solution (1) - Use the Main Function func main name = "test" o1 = new person see o1 class person name address phone Solution (2) - Use special mark for global variable names like $ 53.6. How Ring Deļ¬ne Variables and Attributes 521
  • 5. Ring Documentation, Release 1.3 $name = "test" o1 = new person see o1 class person name address phone Solution (3) - Use the AddAttribute() Method name = "test" o1 = new person see o1 class person AddAttribute(self,"name") address phone Solution (4) - Use self before the attribute name name = "test" o1 = new person see o1 class person self.name address phone So what is the best solution to this conļ¬‚ict? 1 - Use the $ Mark for global variables 2 - Optional : Try to avoid global variables and use the Main function In practice i do both of them. The other solution ā€¢ Use self before the attribute name or use AddAttribute() 53.8 Conļ¬‚ict between Class Attributes and Local Variables This conļ¬‚ict may happen when we access the object using braces Example: func main name = "nice" o1 = new person {name="mahmoud" address="Egypt" phone = 000 } see o1 class person name address phone 53.8. Conļ¬‚ict between Class Attributes and Local Variables 522
  • 6. Ring Documentation, Release 1.3 In the previous example we have the local variable name. The value of this variable will be set to ā€œmahmoudā€ instead of the object attribute. Solution (1) : Just use Self func main name = "nice" o1 = new person {self.name="mahmoud" address="Egypt" phone = 000 } see o1 class person name address phone Solution (2) : Change the Local variable name func main cName = "nice" o1 = new person {name="mahmoud" address="Egypt" phone = 000 } see o1 class person name address phone Solution (3) : Change Braces and use the Dot operator func main name = "nice" o1 = new person o1.name ="mahmoud" o1.address ="Egypt" o1.phone = 000 see o1 class person name address phone 53.9 Using Braces to access objects inside Class Methods Remember that we have Three scopes (Local Scope, Object Scope and Global Scope) and when we are inside a class method, we expect that we have access to the object attributes and methods and this is true until we use braces to access another object attributes and methods because in this case our object scope will be switched to another object. new point { test() } class point x=10 y=20 func test see x + nl + y + nl # works fine myobj = new otherclass { see name + nl see x + nl + y + nl # error ! 53.9. Using Braces to access objects inside Class Methods 523
  • 7. Ring Documentation, Release 1.3 } class otherclass name = "test" Output: 10 20 test Line 8 Error (R24) : Using uninitialized variable : x In method test() in file methodbraceerror.ring called from line 5 in file methodbraceerror.ring Now what we will do to solve the previous problem? Solution (1) : Write the code that access the class attributes outside braces. new point { test() } class point x=10 y=20 func test see x + nl + y + nl # works fine myobj = new otherclass { see name + nl } see x + nl + y + nl # Outside braces - works fine class otherclass name = "test" Output: 10 20 test 10 20 Solution (2) : Donā€™t Use Braces new point { test() } class point x=10 y=20 func test see x + nl + y + nl myobj = new otherclass see myobj.name see x + nl + y + nl class otherclass name = "test" Solution (3) : Copy the self object We may use this solution if we want to use braces and get access to the class attributes (Just Reading). 53.9. Using Braces to access objects inside Class Methods 524
  • 8. Ring Documentation, Release 1.3 new point { test() } class point x=10 y=20 func test oSelf = self see x + nl + y + nl myobj = new otherclass { see name + nl see oself.x + nl + oself.y + nl } class otherclass name = "test" Output: 10 20 test 10 20 Now look at this line oself = self The problem with the previous line is that we will have a new copy from the object Because in Ring the assignment operator copy lists and objects by value (not by reference). When we access the new object attributes (reading) we donā€™t have problems But if we modiļ¬ed the object attributes (Then we will modify the copy!). Note: We can use braces again with the copy new point { test() } class point x=10 y=20 func test oSelf = self see x + nl + y + nl myobj = new otherclass { see name + nl oSelf { see x + nl + y + nl } } class otherclass name = "test" In a GUI application, we may create a class contains the window objects as attributes to be able to access the controls from different methods. Remember the previous information when you try to access objects using braces inside methods because in this case you canā€™t access the object attributes directly and if you copied the self object you will work on a copy and the new controls that you create will be related to the copy and you canā€™t access them. 53.9. Using Braces to access objects inside Class Methods 525
  • 9. Ring Documentation, Release 1.3 53.10 Accessing the class attributes from braces inside class meth- ods We access the class attributes directly from the class methods, also we have the choice to use the Self reference before the attribute/method name. Using Braces {} inside class method change the active object scope and prevent us from getting direct access to the class attributes. Also using Self will not help because the Self reference will be changed to the object that we access using Braces. In this case if you want to read an attribute you have to copy the Self object before using Braces and if you want to modify an attribute you have to the copy from local variable to the object attribute after using Braces. This case happens when you want to read/modify attribute insead braces. Class MyApp oCon # Attribute # some code here Func OpenDatabase # some code here new QSqlDatabase() { oCon = addDatabase("QSQLITE") { setDatabaseName("weighthistory.db") open() } } self.oCon = oCon # some code here In the previous example we want to create the connection object and save it inside the oCon attribute. The object is an output from the addDatabase() method that we use after accessing the QSQLDatabase() object. Inside braces we canā€™t use the Self reference to use the object created from the MyApp class, Because the Self reference here will be to the object that we access using Braces. We solved the problem in the previous example by creating a local variable called oCon then after Braces we copied that variable to the oCon attribute. The next code is another solution. Class MyApp oCon # Attribute # some code here Func OpenDatabase # some code here oCon = new QSqlDatabase() oCon = oCon.addDatabase("QSQLITE") { setDatabaseName("weighthistory.db") Open() } # some code here The next code is a better solution. 53.10. Accessing the class attributes from braces inside class methods 526
  • 10. Ring Documentation, Release 1.3 Class MyApp oCon # Attribute # some code here Func OpenDatabase # some code here new QSqlDatabase() { this.oCon = addDatabase("QSQLITE") { setDatabaseName("weighthistory.db") Open() } } # some code here Note: We used this.attribute to access the class attribute (oCon) while we are inside Braces. 53.11 Creating a Class for each Window in GUI applications A good way for creating classes for windows is to deļ¬ne the window directly after the class name In this area you can use nested braces without problems to deļ¬ne the window and the controls, and they will be attributes that you can access from methods. Example: Load "guilib.ring" new qApp { $ObjectName = "oFirstWindow" oFirstWindow = new FirstWindow $ObjectName = "oSecondWindow" oSecondWindow = new SecondWindow exec() } Class FirstWindow win = new qWidget() { setgeometry(0,50,300,200) setWindowTitle("First Window") label1 = new qLabel(win) { setgeometry(10,10,300,30) setText("0") } btn1 = new qPushButton(win) { move(100,100) setText("Increment") setClickEvent($ObjectName+".increment()") } 53.11. Creating a Class for each Window in GUI applications 527