Diamond Application Development Crafting Solutions with Precision
The Ring programming language version 1.10 book - Part 211 of 212
1. Ring Documentation, Release 1.10
Ring mode for Emacs Editor
What is new in Ring 1.3?, 163
Ring Notepad
Introduction, 204
Ring Notepad - Creating and running your first con-
sole application, 205
Ring Notepad - Creating and running your first game,
210
Ring Notepad - Creating and running your first GUI
application, 208
Ring Notepad - Creating and running your first Web
application, 209
Ring Notepad - Main Window, 205
The Browser Menu, 215
The Distribute Menu, 216
The Edit Menu, 213
The File Menu, 212
The Help Menu, 216
The Main File in the Project, 211
The Program Menu, 215
The Tools Menu, 216
The View Menu, 213
Ring Notepad - Creating and running your first console
application
Ring Notepad, 205
Ring Notepad - Creating and running your first game
Ring Notepad, 210
Ring Notepad - Creating and running your first GUI ap-
plication
Ring Notepad, 208
Ring Notepad - Creating and running your first Web ap-
plication
Ring Notepad, 209
Ring Notepad - Main Window
Ring Notepad, 205
Ring Package Manager (RingPM)
Create Package in the Current Folder, 879
Creating New Package, 876
Deleting All Packages, 876
Discovering Packages, 873
Features, 873
Installing Packages, 874
Introduction, 872
Printing List of Installed Packages, 875
Remove Package, 876
Run Package, 875
The Package Description File, 878
The RingPM Registry File, 881
Update Package, 875
Updating the RingPM Registry, 874
Ring source code files and permissions
Deploying Web Applications in the Cloud, 514
Ring State
Embedding Ring Language in C/C++ Programs, 925
Ring State Functions
Embedding Ring Language in C/C++ Programs, 925
Ring State Variables
Embedding Ring Language in C/C++ Programs, 926
Ring VM - Tracing Functions
What is new in Ring 1.5?, 125
ring_ext.c
Extension, 914
ring_ext.h
Extension, 914
ring_state_new() and ring_state_mainfile()
Embedding Ring in Ring, 912
ring_state_new() and ring_state_mainfile() functions
What is new in Ring 1.7?, 83
ring_state_setvar()
Embedding Ring in Ring, 911
RingAllegro Functions Reference
Introduction, 1245
RingCodeHighlighter Class
RingQt Classes Reference, 1214
RingConsoleColors Extension
What is new in Ring 1.6?, 92
RingConsoleColors Functions Reference
Introduction, 1243
RingFreeGLUT Extension
What is new in Ring 1.5?, 111
RingFreeGLUT Functions Reference
Introduction, 1298
RingLibCurl
Facebook Login, 517
Get Request, 517
Get Stock Data From Yahoo, 519
Introduction, 516
Post Request, 517
Save output to string, 518
What is new in Ring 1.2?, 172
RingLibCurl Functions Reference
Introduction, 1233
RingLibSDL
Close Window Event, 541
Create Window, 538
Display Image, 538
Display PNG Images, 539
Display Transparent Images, 540
Draw Rectangle, 539
Introduction, 537
Mouse Events, 542
Play Sound, 543
Switch Between Two Images, 538
Use TTF Fonts, 540
What is new in Ring 1.1?, 181
RingLibSDL Functions Reference
Introduction, 1264
RingLibuv
Index 2068
2. Ring Documentation, Release 1.10
Client Example, 547
Client Example - Using Classes, 550
First Application using RingLibuv, 545
Introduction, 544
Server Example, 546
Server Example using Classes, 549
The Events Loop, 546
Threads Example, 551
Threads Example - Using Classes, 552
RingLibuv Extension
What is new in Ring 1.7?, 86
RingLibuv Functions Reference
Introduction, 1289
RingLibZip Functions Reference
Introduction, 1242
RingMurmurHash Extension
What is new in Ring 1.6?, 92
RingMurmurHash Functions Reference
Example, 1215
Introduction, 1214
MurmurHash1 functions, 1215
MurmurHash2 functions, 1215
MurmurHash3 functions, 1215
RingOpenGL (OpenGL 1.1) Functions Reference
Introduction, 1307
RingOpenGL (OpenGL 1.2) Functions Reference
Introduction, 1332
RingOpenGL (OpenGL 1.3) Functions Reference
Introduction, 1358
RingOpenGL (OpenGL 1.4) Functions Reference
Introduction, 1387
RingOpenGL (OpenGL 1.5) Functions Reference
Introduction, 1417
RingOpenGL (OpenGL 2.0) Functions Reference
Introduction, 1448
RingOpenGL (OpenGL 2.1) Functions Reference
Introduction, 1482
RingOpenGL (OpenGL 3.0) Functions Reference
Introduction, 1524
RingOpenGL (OpenGL 3.1) Functions Reference
Introduction, 1569
RingOpenGL (OpenGL 3.2) Functions Reference
Introduction, 1615
RingOpenGL (OpenGL 3.3) Functions Reference
Introduction, 1662
RingOpenGL (OpenGL 4.0) Functions Reference
Introduction, 1708
RingOpenGL (OpenGL 4.1) Functions Reference
Introduction, 1755
RingOpenGL (OpenGL 4.2) Functions Reference
Introduction, 1802
RingOpenGL (OpenGL 4.3) Functions Reference
Introduction, 1849
RingOpenGL (OpenGL 4.4) Functions Reference
Introduction, 1896
RingOpenGL (OpenGL 4.5) Functions Reference
Introduction, 1943
RingOpenGL (OpenGL 4.6) Functions Reference
Introduction, 1990
RingOpenGL Extension
What is new in Ring 1.5?, 120
RingPostgreSQL Constants
PostgreSQL, 344
RingPostgreSQL Extension
What is new in Ring 1.9?, 59
RingPostgreSQL Functions
PostgreSQL, 345
RingQt Classes and their Qt Documentation
Desktop and Mobile Development, 783
RingQt Classes Reference
CodeEditor Class, 1000
Introduction, 999
QAbstractButton Class, 1000
QAbstractItemView Class, 1001
QAbstractPrintDialog Class, 1003
QAbstractScrollArea Class, 1003
QAbstractSlider Class, 1004
QAbstractSocket Class, 1005
QAbstractSpinBox Class, 1006
QAction Class, 1007
QAllEvents Class, 1008
QApp Class, 1013
QAxBase Class, 1013
QAxObject Class, 1015
QAxWidget Class, 1015
QBitmap Class, 1015
QBluetoothAddress Class, 1015
QBluetoothDeviceDiscoveryAgent Class, 1015
QBluetoothDeviceInfo Class, 1016
QBluetoothHostInfo Class, 1016
QBluetoothLocalDevice Class, 1017
QBluetoothServer Class, 1018
QBluetoothServiceDiscoveryAgent Class, 1018
QBluetoothServiceInfo Class, 1019
QBluetoothSocket Class, 1020
QBluetoothTransferManager Class, 1021
QBluetoothTransferReply Class, 1021
QBluetoothTransferRequest Class, 1021
QBluetoothUuid Class, 1021
QBoxLayout Class, 1022
QBrush Class, 1022
QBuffer Class, 1023
QButtonGroup Class, 1023
QByteArray Class, 1024
QCalendarWidget Class, 1026
QCamera Class, 1027
QCameraImageCapture Class, 1028
QCameraViewfinder Class, 1029
Index 2069
5. Ring Documentation, Release 1.10
QXmlStreamNotationDeclaration Class, 1211
QXmlStreamReader Class, 1211
QXmlStreamWriter Class, 1213
RingCodeHighlighter Class, 1214
RingREPL
What is new in Ring 1.4?, 147
RingSQLite
What is new in Ring 1.1?, 182
ringvm_callfunc()
Low Level Functions, 895
RingVM_CallList()
Low Level Functions, 892
RingVM_CFunctionsList()
Low Level Functions, 887
RingVM_ClassesList()
Low Level Functions, 888
ringvm_evalinscope()
Low Level Functions, 894
RingVM_FilesList()
Low Level Functions, 892
RingVM_FunctionsList()
Low Level Functions, 887
ringvm_give() function
Low Level Functions, 903
ringvm_hideerrorMsg()
Low Level Functions, 895
ringvm_info()
Low Level Functions, 903
RingVM_MemoryList()
Low Level Functions, 890
RingVM_PackagesList()
Low Level Functions, 889
ringvm_passerror()
Low Level Functions, 895
ringvm_scopescount()
Low Level Functions, 894
ringvm_see() and ringvm_give() functions
What is new in Ring 1.7?, 82
ringvm_see() function
Low Level Functions, 903
ringvm_settrace()
Low Level Functions, 893
ringvm_tracedata()
Low Level Functions, 893
ringvm_traceevent()
Low Level Functions, 894
ringvm_tracefunc()
Low Level Functions, 894
RingZip
Create Zip File, 521
Extract Zip File, 521
Introduction, 520
Print files in Zip file, 521
Using RingZip Classes, 521
Zip Class Reference, 523
ZipEntry Class Reference, 523
RingZip Library
What is new in Ring 1.3?, 166
Rotate Text
Desktop and Mobile Development, 746
Rules
The Type Hints Library, 839
Run Package
Ring Package Manager (RingPM), 875
Run the program
Getting Started - First Style, 197
Getting Started - Second Style, 200
Getting Started - Third Style, 202
Running Forms
Form Designer, 798
Runtime Errors
Reference, 990
Runtime Errors when Embedding Ring in Ring
Embedding Ring in Ring, 913
Samples
How to contribute?, 195
Samples in this book
Applications developed in little hours, 15
Samples Source (Authors)
Using RingOpenGL and RingFreeGLUT for 3D
Graphics, 606
Save and Restore Images
ODBC Functions, 327
Save Image Inside the Database
MySQL Functions, 335
Save output to string
RingLibCurl, 518
Scaling and Rotating Images
Graphics and Game Programming, 533
Scope Rules
Accessing the class attributes from braces inside
class methods, 814
Conflict between Class Attributes and Local Vari-
ables, 811
Conflict between Global Variables and Class At-
tributes, 810
Conflict between self inside braces and self in the
class region, 817
Creating a Class for each Window in GUI applica-
tions, 816
Defining Variables and Variables Access, 808
How Ring find the Variable?, 809
Introduction, 807
Summary of Scope Rules, 821
The For Loops uses the local scope, 821
The Self Object, 809
Three Scopes, 808
Index 2072
6. Ring Documentation, Release 1.10
Using Braces to access objects inside Class Methods,
812
Using braces to escape from the current object scope,
820
Using Object.Attribute, 809
Scope Rules for Functions and Methods
Calling a function sharing the name with a method in
the current class, 826
Example about Sharing Names between Functions
and Methods, 824
How Ring find a functions and methods?, 824
Introduction, 823
Screen Shots
The Gold Magic 800 Game, 676
ScriptFunctions Class
Web Development (CGI Library), 510
Search
Lists, 263
Search of global names while defining the class attributes
Frequently Asked Questions, 963
Security and Internet Functions
Decrypt(), 351
Download(), 352
Encrypt(), 350
Example, 351
File Hash, 351
Introduction, 347
MD5(), 348
RandBytes(), 352
SendEmail(), 352
SHA1(), 349
SHA224(), 350
SHA256(), 349
SHA384(), 350
SHA512(), 349
Security Class
Stdlib Classes, 434
Send Parameters
Functions - First Style, 248
Functions - Second Style, 252
Functions - Third Style, 256
SendEmail()
Security and Internet Functions, 352
Serial Execution of Programs
Embedding Ring in Ring, 910
Server Example
RingLibuv, 546
Server Example using Classes
RingLibuv, 549
Set List Item
Lists, 262
setattribute()
Reflection and Meta-programming, 390
Setter and Getter
Object Oriented Programming, 358
SHA1()
Security and Internet Functions, 349
SHA224()
Security and Internet Functions, 350
SHA256()
Security and Internet Functions, 349
SHA384()
Security and Internet Functions, 350
SHA512()
Security and Internet Functions, 349
Shared Libraries
Extension, 922
Short-circuit evaluation
Control Structures - First Style, 234
Shutdown() Function
System Functions, 312
sign()
Stdlib Functions, 399
Simple
Language Design, 31
Simple Client and Server Example
Desktop and Mobile Development, 750
Sin() Implementation
Extension, 918
Single: Desktop and Mobile Development
Introduction, 679
sleep()
Stdlib Functions, 406
Smart Garbage Collector
Language Design, 39
Snakes And Ladder Game
What is new in Ring 1.10?, 46
Sort()
Lists, 263
Sort() and List of Objects
Object Oriented Programming, 365
Sound Class
Game Engine for 2D Games, 557
Source Code
Resources, 2039
The Gold Magic 800 Game, 678
Source Code File Sections
Program Structure, 259
space()
Low Level Functions, 884
Special Thanks
Introduction, 25
Special thanks to contributors
How to contribute?, 195
split()
Stdlib Functions, 396
splitmany()
Stdlib Functions, 396
Index 2073
7. Ring Documentation, Release 1.10
Sprite Automatic Movement
Game Engine for 2D Games, 564
Sprite Class
Game Engine for 2D Games, 556
Sprite Keypress Event
Game Engine for 2D Games, 565
Sprite Mouse Event
Game Engine for 2D Games, 566
Sprite State Event
Game Engine for 2D Games, 567
SQLite
Introduction, 337
sqlite_close(), 338
sqlite_execute(), 338
sqlite_init(), 338
sqlite_open(), 338
SQLite Class
Stdlib Classes, 432
sqlite_close()
SQLite, 338
sqlite_execute()
SQLite, 338
sqlite_init()
SQLite, 338
sqlite_open()
SQLite, 338
Squares Puzzle Game
Applications developed in little hours, 10
SRandom()
Mathematical Functions, 293
Stack Class
Stdlib Classes, 417
Stars Fighter Game
Game Engine for 2D Games, 576
startswith()
Stdlib Functions, 400
Static Methods
Code Generator, 946
StdBase Class
Stdlib Classes, 412
Stdlib Classes
Conversion Class, 429
DataType Class, 428
DateTime Class, 423
Debug Class, 427
File Class, 425
HashTable Class, 418
Internet Class, 435
Introduction, 411
List Class, 415
Math Class, 420
MySQL Class, 431
ODBC Class, 430
PostgreSQL Class, 433
Queue Class, 417
Security Class, 434
SQLite Class, 432
Stack Class, 417
StdBase Class, 412
String Class, 413
System Class, 426
Tree Class, 419
Stdlib Functions
apppath(), 394
ASCIIList2Str(), 410
binarydigits(), 403
capitalized(), 397
changestring(), 406
dayofweek(), 404
direxists(), 406
endswith(), 400
EpochTime(), 408
evenorodd(), 402
factorial(), 398
factors(), 402
fibonacci(), 399
file2list(), 400
filter(), 396
FSize(), 407
gcd(), 401
getnumber(), 394
getstring(), 394
Introduction, 392
isleapyear(), 403
ismainsourcefile(), 406
ispalindrome(), 403
isprime(), 399
isspecial(), 397
isvowel(), 398
JustFileName(), 395
JustFilePath(), 394
lcm(), 401
linecount(), 398
List2Code() Function, 410
list2file(), 399
ListAllFiles() Function, 408
makedir(), 407
map(), 396
matrixmulti(), 403
matrixtrans(), 404
newlist(), 397
OSCopyFile() Function, 409
OSCopyFolder() Function, 409
OSCreateOpenFolder() Function, 409
OSDeleteFile() Function, 410
OSDeleteFolder() Function, 409
OSRenameFile() Function, 410
permutation(), 404
Index 2074
8. Ring Documentation, Release 1.10
print(), 393
Print2Str() Function, 393
prodlist(), 402
puts(), 393
readline(), 405
sign(), 399
sleep(), 406
split(), 396
splitmany(), 396
startswith(), 400
Str2ASCIIList(), 410
substring(), 405
sumlist(), 401
SystemCmd() Function, 408
SystemSilent() Function, 409
times(), 395
TrimAll(), 407
TrimLeft(), 407
TrimRight(), 408
value(), 395
StdLib functions and classes written in Ring
What is new in Ring 1.1?, 179
Step Option
Control Structures - First Style, 232
Steps to create the extension
Create your first extension, 949
StopWatch Application
What is new in Ring 1.8?, 70
Str2ASCIIList()
Stdlib Functions, 410
Str2Hex()
Data Type, 289
str2list() and list2str()
Strings, 275
strcmp()
Strings, 275
String Class
Stdlib Classes, 413
String Literals
Strings, 271
String()
Data Type, 287
String2Constant Application
What is new in Ring 1.8?, 69
Strings
Access String Letters, 271
Convert Letters Case, 271
Copy(), 273
Find SubString, 274
Get Number of Characters from position, 274
Get String Length, 271
Get Substring from position to end, 274
Introduction, 270
Left(), 272
Lines(), 273
Merge binary characters, 276
Right(), 272
str2list() and list2str(), 275
strcmp(), 275
String Literals, 271
Substr(), 273
Transform Substring To Another Substring, 274
Trim(), 273
StyleFunctions Class
Web Development (CGI Library), 510
Substr()
Strings, 273
substring()
Stdlib Functions, 405
sumlist()
Stdlib Functions, 401
Summary of Scope Rules
Scope Rules, 821
Super Man 2016 Game
Game Engine for 2D Games, 591
Swap Items
Lists, 269
Switch Between Two Images
RingLibSDL, 538
Switch Statement
Control Structures - First Style, 230
Control Structures - Second Style, 237
Control Structures - Third Style, 240
Syntax Flexibility
Change Language Keywords, 828
Change Language Operators, 829
Ignore new lines after keywords, 837
Introduction, 827
Language Design, 37
Load Syntax Files, 829
Using ’case’ as ’on’ in switch statements, 835
Using ’def’ as ’func’ in functions/methods defini-
tion, 835
Using ’end’ keyword after Pack-
ages/Classes/Functions, 836
Using ’endpackage’/’endclass’/’endfunc’ keywords
after Packages/Classes/Functions, 836
Using ’put’ and ’get’ as ’see’ and ’give’, 835
Using () around the function parameters, 829
in the start of the variable name, 832
Using braces { } in Packages/Classes/Functions, 836
Using braces to start and end different control struc-
tures, 834
Using Semi-colon after and between statements, 831
Using the ’else’ keyword as ’other’ in switch state-
ment, 832
Using the ’elseif’ keyword as ’but’ in if statement,
832
Index 2075
9. Ring Documentation, Release 1.10
Using the ’end’ keyword in different control struc-
tures, 833
What is new in Ring 1.1?, 176
SysGet() Function
System Functions, 307
System Class
Stdlib Classes, 426
System Functions
ChDir() Function, 311
CurrentDir() Function, 311
Example, 308
ExeFileName() Function, 311
ExeFolder() Function, 311
Get Active Source File Name, 310
Get Command Line Arguments, 309
Introduction, 305
IsAndroid() Function, 308
IsFreeBSD() Function, 308
IsLinux() Function, 308
IsMacOSX() Function, 307
IsMSDOS() Function, 307
IsUnix() Function, 307
IsWindows() Function, 307
IsWindows64() Function, 307
PrevFileName() Function, 310
Shutdown() Function, 312
SysGet() Function, 307
System() Function, 306
Version() Function, 311
Windowsnl() Function, 309
System() Function
System Functions, 306
SystemCmd() Function
Stdlib Functions, 408
SystemSilent() Function
Stdlib Functions, 409
Tempfile()
Files, 300
Templates
Web Development (CGI Library), 474
Tempname()
Files, 300
Testing
How to contribute?, 195
Testing the extension
Create your first extension, 950
Text Class
Game Engine for 2D Games, 556
The Browser Menu
Ring Notepad, 215
The Camera
Using RingOpenGL and RingFreeGLUT for 3D
Graphics, 616
The Cards Game
Demo Programs, 772
Desktop and Mobile Development, 772
The Designer Windows
Form Designer, 797
The Difference between Qt and RingQt
Desktop and Mobile Development, 782
The Distribute Menu
Ring Notepad, 216
The documentation says functional programming is sup-
ported, but then this happens?
Frequently Asked Questions, 955
The Edit Menu
Ring Notepad, 213
The Events Loop
Desktop and Mobile Development, 681
RingLibuv, 546
The File Menu
Ring Notepad, 212
The files ring.ring and ring.ringo
Distributing Ring Application, 863
The First GUI Application
Desktop and Mobile Development, 680
The First Triangle
Using RingOpenGL and RingFreeGLUT for 3D
Graphics, 609
The First Window using RingFreeGLUT
Using RingOpenGL and RingFreeGLUT for 3D
Graphics, 607
The For Loops uses the local scope
Scope Rules, 821
What is new in Ring 1.8?, 75
The Game Story
The Gold Magic 800 Game, 676
The Gold Magic 800 Game
How to play?, 676
Introduction, 675
Screen Shots, 676
Source Code, 678
The Game Story, 676
What will you learn?, 676
The Help Menu
Ring Notepad, 216
The Main File in the Project
Ring Notepad, 211
The Natural Library
What is new in Ring 1.4?, 145
The Package Description File
Ring Package Manager (RingPM), 878
The Program Menu
Ring Notepad, 215
The Properties
Form Designer, 797
The Qt project for your Ring application
Index 2076
10. Ring Documentation, Release 1.10
Building RingQt Applications for Mobile, 788
The Ring Package Manager (RingPM)
What is new in Ring 1.10?, 49
The RingPM Registry File
Ring Package Manager (RingPM), 881
The Self Object
Scope Rules, 809
The Tools Menu
Ring Notepad, 216
The Trace Library and the Interactive Debugger
BreakPoint, 907
Disable BreakPoints, 907
Execute Program Line by Line, 906
Interactive Debugger, 906
Introduction, 904
Loading the Trace library, 905
Pass Error, 906
Trace All Events, 905
Trace control flow between functions, 905
Using the Interactive Debugger, 907
The Type Hints Library
Example, 838
Introduction to the Type Hints Library, 837
Rules, 839
User Types, 838
Using Types inside Code, 839
Why Type Hints?, 838
The View Menu
Ring Notepad, 213
Threads
Graphics and Game Programming, 535
Threads Example
RingLibuv, 551
Threads Example - Using Classes
RingLibuv, 552
Threads Support
Code Generator, 935
Three Scopes
Scope Rules, 808
TicTacToe 3D Game
Using RingOpenGL and RingAllegro for 3D Graph-
ics, 663
TicTacToe Game
Applications developed in little hours, 9
Time()
Date and Time, 278
TimeList()
Date and Time, 279
times()
Stdlib Functions, 395
Trace All Events
The Trace Library and the Interactive Debugger, 905
Trace control flow between functions
The Trace Library and the Interactive Debugger, 905
Trace Library and Interactive Debugger
What is new in Ring 1.5?, 129
Transaction Example
MySQL Functions, 336
Transactions and Using Commit and Rollback
ODBC Functions, 326
Transform Substring To Another Substring
Strings, 274
Transparent Image
Graphics and Game Programming, 534
Transparent Implementation
Language Design, 37
Tree Class
Stdlib Classes, 419
Triangle Rotation
Using RingOpenGL and RingFreeGLUT for 3D
Graphics, 612
Trim()
Strings, 273
TrimAll()
Stdlib Functions, 407
TrimLeft()
Stdlib Functions, 407
TrimRight()
Stdlib Functions, 408
TrueType Fonts
Graphics and Game Programming, 531
Try/Carch/Done
Eval() and Debugging, 313
Trying to be natural
Language Design, 32
Type Hints Library
What is new in Ring 1.5?, 132
Type()
Data Type, 283
Ungetc()
Files, 302
Unsigned()
Mathematical Functions, 293
Update Package
Ring Package Manager (RingPM), 875
Update the Android SDK
Building RingQt Applications for Mobile, 787
Updating the RingPM Registry
Ring Package Manager (RingPM), 874
Upload Files
Web Development (CGI Library), 468
URL Encode
Web Development (CGI Library), 473
Usage
Deploying Web Applications in the Cloud, 513
Use TTF Fonts
RingLibSDL, 540
Index 2077