SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
36.18 attributes() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
36.19 methods() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
36.20 isattribute() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
36.21 isprivateattribute() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
36.22 ismethod() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
36.23 isprivatemethod() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
36.24 addattribute() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
36.25 addmethod() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
36.26 getattribute() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
36.27 setattribute() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
36.28 mergemethods() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
37 Stdlib Functions 202
37.1 puts() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
37.2 print() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
37.3 getstring() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
37.4 getnumber() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
37.5 apppath() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
37.6 value() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
37.7 times() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
37.8 map() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
37.9 filter() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
37.10 split() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
37.11 newlist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
37.12 capitalized() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
37.13 isspecial() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
37.14 isvowel() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
37.15 linecount() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
37.16 factorial() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
37.17 fibonacci() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
37.18 isprime() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
37.19 sign() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
37.20 list2file() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
37.21 file2list() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
37.22 startswith() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
37.23 endswith() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
37.24 gcd() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
37.25 lcm() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
37.26 sumlist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
37.27 prodlist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
37.28 evenorodd() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
37.29 factors() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
37.30 palindrome() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
37.31 isleapyear() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
37.32 binarydigits() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
37.33 matrixmulti() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
37.34 matrixtrans() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
37.35 dayofweek() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
37.36 permutation() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
37.37 readline() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
37.38 substring() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
37.39 changestring() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
37.40 sleep() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
37.41 ismainsourcefile() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
ix
37.42 direxists() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
37.43 makedir() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
38 Stdlib Classes 216
38.1 StdBase Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
38.2 String Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
38.3 List Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
38.4 Stack Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
38.5 Queue Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
38.6 HashTable Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
38.7 Tree Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
38.8 Math Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
38.9 DateTime Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
38.10 File Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
38.11 System Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
38.12 Debug Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
38.13 DataType Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
38.14 Conversion Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
38.15 ODBC Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
38.16 MySQL Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
38.17 SQLite Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
38.18 Security Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
38.19 Internet Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
39 Declarative Programming using Nested Structures 239
39.1 Creating Objects inside Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
39.2 Composition and Returning Objects and Lists by Reference . . . . . . . . . . . . . . . . . . . . . . 240
39.3 Executing code after the end of object access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
39.4 Declarative Programming on the top of Object-Oriented . . . . . . . . . . . . . . . . . . . . . . . . 242
39.5 More beautiful Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
40 Natural Language Programming 245
40.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
40.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
40.3 Change the Ring Keyword ‘And’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
40.4 Change the Ring Operator ‘+’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
40.5 Change the ‘=’ operator to ‘is’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
40.6 Using Eval() with our Natural Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
40.7 BraceStart and BraceEnd Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
40.8 BraceExprEval Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
40.9 Real Natural Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
40.10 BraceError() Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
40.11 Clean Natural Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
41 Web Development (CGI Library) 255
41.1 Configure the Apache web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
41.2 Ring CGI Hello World Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
41.3 Hello World Program using the Web Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
41.4 Web Library Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
41.5 HTTP Get Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
41.6 HTTP POST Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
41.7 Upload Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
41.8 Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
41.9 URL Encode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
41.10 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
x
41.11 HTML Special Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
41.12 Hash Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
41.13 Random Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
41.14 HTML Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
41.15 HTML Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
41.16 Gradient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
41.17 Generating Pages using Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
41.18 Using Bootstrap Library using Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
41.19 Using Bootstrap Library using Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
41.20 CRUD Example using MVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
41.21 Users registration and Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
41.22 Database, ModelBase & ControllerBase classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
41.23 WebLib API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
41.24 Application Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
41.25 Page Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
41.26 ScriptFunctions Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
41.27 StyleFunctions Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
42 Using RingLibCurl 307
42.1 Get Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
42.2 Post Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
42.3 Facebook Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
42.4 Save Output to String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
43 Graphics and 2D Games programming using RingAllegro 310
43.1 Drawing, Animation and Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
43.2 Using TrueType Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
43.3 Playing Sound Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
43.4 Scaling and Rotating Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
43.5 Display Transparent Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
43.6 Using Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
44 Using RingLibSDL 323
44.1 Create Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
44.2 Display Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
44.3 Switch between two images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
44.4 Draw Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
44.5 Display PNG Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
44.6 Use TTF Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
44.7 Display Transparent Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
44.8 Close Window Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
44.9 Mouse Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
44.10 Play Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
45 Demo Project - Game Engine for 2D Games 330
45.1 Project Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
45.2 Graphics Library bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
45.3 Interface to graphics library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
45.4 Game Engine Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
45.5 Games Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
45.6 Game Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
45.7 GameObject Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
45.8 Sprite Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
45.9 Text Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
45.10 Animate Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
xi
45.11 Sound Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
45.12 Map Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
45.13 Using the Game Engine - Creating the Game Window . . . . . . . . . . . . . . . . . . . . . . . . . 335
45.14 Using the Game Engine - Drawing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
45.15 Using the Game Engine - Moving Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
45.16 Using the Game Engine - Playing Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
45.17 Using the Game Engine - Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
45.18 Using the Game Engine - Animation and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
45.19 Using the Game Engine - Sprite - Automatic Movement using Keyboard . . . . . . . . . . . . . . . 342
45.20 Using the Game Engine - Sprite - Keypress event . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
45.21 Using the Game Engine - Sprite - Mouse event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
45.22 Using the Game Engine - Sprite - State event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
45.23 Using the Game Engine - Animate - Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
45.24 Using the Game Engine - Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
45.25 Using the Game Engine - Map Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
45.26 Using the Game Engine - Object and Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
45.27 Stars Fighter Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
45.28 Flappy Bird 3000 Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
45.29 Super Man 2016 Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
46 Building Games For Android 380
46.1 Download Requirements and Update the Android SDK . . . . . . . . . . . . . . . . . . . . . . . . . 380
46.2 Project Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
46.3 Building the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
47 Desktop and Mobile development using RingQt 383
47.1 The First GUI Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
47.2 Using Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
47.3 Using the QTextEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
47.4 Using the QListWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
47.5 Using QTreeView and QFileSystemModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
47.6 Using QTreeWidget and QTreeWidgetItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
47.7 Using QComboBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
47.8 Creating Menubar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
47.9 Creating Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
47.10 Creating StatusBar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
47.11 Using QDockWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
47.12 Using QTabWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
47.13 Using QTableWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
47.14 Using QProgressBar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
47.15 Using QSpinBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
47.16 Using QSlider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
47.17 Using QDateEdit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
47.18 Using QDial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
47.19 Using QWebView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
47.20 Using QCheckBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
47.21 Using QRadioButton and QButtonGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
47.22 Adding Hyperlink to QLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
47.23 QVideoWidget and QMediaPlayer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
47.24 Using QFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
47.25 Display Image using QLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
47.26 Menubar and StyleSheet Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
47.27 QLineEdit Events and QMessageBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
47.28 Other Widgets Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
xii
47.29 Using the QTimer Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
47.30 Using QProgressBar and Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
47.31 Display Scaled Image using QLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
47.32 Using the QFileDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
47.33 Drawing using QPainter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
47.34 Printing using QPrinter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
47.35 Creating More than one Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
47.36 Playing Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
47.37 Using the QColorDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
47.38 Using qLCDNumber Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
47.39 Movable Label Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
47.40 QMessagebox Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
47.41 Using QInputDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
47.42 KeyPress and Mouse Move Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
47.43 Moving Objects using the Mouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
47.44 Inheritance from GUI Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
47.45 Using QDesktopWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
47.46 Rotate Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
47.47 Change Focus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
47.48 Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
47.49 Simple Client and Server Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
47.50 Dynamic Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
47.51 Weight History Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
47.52 Notepad Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
47.53 The Cards Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
47.54 Classes and their Methods to use the default events . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
47.55 Methods to use Events with Events Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
47.56 The Difference between Qt and RingQt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
47.57 RingQt Classes and their Qt Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
48 Building RingQt Applications for Mobile 483
48.1 Download Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
48.2 Update the Android SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
48.3 Install Qt for Android . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
48.4 Comments about developing for Android using RingQt . . . . . . . . . . . . . . . . . . . . . . . . . 484
49 Objects Library for RingQt Application 486
49.1 Library Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
49.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
49.3 Objects Library Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
50 Scope Rules for Variables and Attributes 492
50.1 Three Scopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
50.2 Defining Variables and Variables Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
50.3 How Ring find the variable? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
50.4 Using Object.Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
50.5 The Self Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
50.6 How Ring Define Variables and Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
50.7 Conflict between Global Variables and Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . 494
50.8 Conflict between Class Attributes and Local Variables . . . . . . . . . . . . . . . . . . . . . . . . . 495
50.9 Using Braces to access objects inside Class Methods . . . . . . . . . . . . . . . . . . . . . . . . . . 496
50.10 Accessing the class attributes from braces inside class methods . . . . . . . . . . . . . . . . . . . . 499
50.11 Creating a Class for each Window in GUI applications . . . . . . . . . . . . . . . . . . . . . . . . . 500
50.12 Conflict between self inside braces and self in the class region . . . . . . . . . . . . . . . . . . . . . 501
xiii
50.13 Using braces to escape from the current object scope . . . . . . . . . . . . . . . . . . . . . . . . . . 504
50.14 Summary of Scope Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
51 Scope Rules for Functions and Methods 507
51.1 How Ring find the Functions and Methods? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
51.2 Example about Sharing Names between Functions and Methods . . . . . . . . . . . . . . . . . . . . 508
51.3 Calling a function sharing the name with a method in the current class . . . . . . . . . . . . . . . . . 509
52 Syntax Flexibility 511
52.1 Change Language Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
52.2 Change Language Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
52.3 Load Syntax Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
52.4 Using “()” around the function parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
52.5 Using Semi-colon after and between statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
52.6 Using $ and @ in the start of the variable name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
52.7 Using the ‘elseif’ keyword as ‘but’ in if statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
52.8 Using the ‘else’ keyword as ‘other’ in switch statement . . . . . . . . . . . . . . . . . . . . . . . . . 516
52.9 Using the ‘end’ keyword in different control structures . . . . . . . . . . . . . . . . . . . . . . . . . 516
52.10 Using braces to start and end different control structures . . . . . . . . . . . . . . . . . . . . . . . . 517
52.11 Using ‘put’ and ‘get’ as ‘see’ and ‘give’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
52.12 Using ‘case’ as ‘on’ in switch statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
52.13 Using ‘def’ as ‘func’ in functions/methods definition . . . . . . . . . . . . . . . . . . . . . . . . . . 519
53 Distributing Ring Applications 520
53.1 Distributing Applications for Microsoft Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
53.2 Protecting the Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
53.3 Creating Windows Installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
53.4 Using C/C++ Compiler and Linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
53.5 Distributing Applications and Games for Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
54 Command Line Options 522
54.1 Printing Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
54.2 Printing Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
54.3 Printing Intermediate Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
54.4 Printing Final Intermediate Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
54.5 CGI Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
54.6 No Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
54.7 Printing Instruction Operation Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
54.8 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
54.9 Generate Object File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
55 Low Level Functions 537
55.1 callgc() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
55.2 varptr() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
55.3 space() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
55.4 nullpointer() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
55.5 object2pointer() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
55.6 pointer2object() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
55.7 ptrcmp() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
55.8 ringvm_cfunctionslist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
55.9 ringvm_functionslist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
55.10 ringvm_classeslist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
55.11 ringvm_packageslist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
55.12 ringvm_memorylist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
55.13 ringvm_calllist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
xiv
55.14 ringvm_fileslist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
56 Extension using the C/C++ languages 547
56.1 ring_ext.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
56.2 ring_ext.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
56.3 Module Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
56.4 Function Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
56.5 Check Parameters Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
56.6 Display Error Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
56.7 Check Parameters Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
56.8 Get Parameters Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
56.9 Return Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
56.10 Function Prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
56.11 Sin() Function Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
56.12 Fopen() and Fclose() Functions Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
56.13 Ring API - List Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
56.14 Ring API - String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
56.15 MySQL_Columns() Function Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
56.16 Dynamic/Shared Libraries (DLL/So) and LoadLib() function . . . . . . . . . . . . . . . . . . . . . 555
57 Embedding Ring Language in C/C++ Programs 557
57.1 Ring State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
57.2 Ring State Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
57.3 Ring State Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
58 Code Generator for wrapping C/C++ Libraries 560
58.1 Using the tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
58.2 Configuration file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
58.3 Using the function prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
58.4 Adding code to the generated code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
58.5 Prefix for Functions Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
58.6 Generate function to wrap structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
58.7 Determine Structure Members Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
58.8 Defining Contants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
58.9 Register New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
58.10 Writing comments in the configuration file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
58.11 Executing code during code generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
58.12 Enum and Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
58.13 Filtering using Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
58.14 Configuration file for the Allegro Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
58.15 Threads Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
58.16 Code Generator Rules for Wrapping C++ Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
58.17 Using configuration file that wrap C++ Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
58.18 Configuration file for the Qt Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
58.19 Configuration Files Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
59 RingLibCurl Functions Reference 579
60 RingAllegro Functions Reference 581
61 RingLibSDL Functions Reference 600
62 RingQt Classes Reference 616
62.1 QApp Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
62.2 QTest Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
xv
62.3 QObject Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
62.4 QWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
62.5 QLabel Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
62.6 QPushButton Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
62.7 QBitmap Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
62.8 QPixmap Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
62.9 QIcon Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
62.10 QSize Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
62.11 QLineEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
62.12 QVBoxLayout Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
62.13 QHBoxLayout Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
62.14 QTextEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
62.15 QListWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
62.16 QTreeView Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
62.17 QDir Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
62.18 QFileSystemModel Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
62.19 QTreeWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
62.20 QTreeWidgetItem Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
62.21 QComboBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
62.22 QMenuBar Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
62.23 QMenu Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
62.24 QToolBar Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
62.25 QMainWindow Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
62.26 QStatusBar Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
62.27 QDockWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
62.28 QTabWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
62.29 QTableWidgetItem Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
62.30 QFrame Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
62.31 QAbstractScrollArea Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
62.32 QAbstractItemView Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
62.33 QTableView Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
62.34 QTableWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
62.35 QProgressBar Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
62.36 QSpinBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
62.37 QAbstractSlider Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
62.38 QSlider Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
62.39 QDateEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
62.40 QDateTimeEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
62.41 QAbstractSpinBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
62.42 QDial Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
62.43 QWebView Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
62.44 QUrl Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
62.45 QCheckBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
62.46 QAbstractButton Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
62.47 QRadioButton Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
62.48 QButtonGroup Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
62.49 QMediaPlayer Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
62.50 QMediaPlaylist Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
62.51 QVideoWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
62.52 QAction Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
62.53 QEvent Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
62.54 QMessageBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
62.55 QTimer Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
62.56 QFileDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
xvi
62.57 QPainter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
62.58 QPicture Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
62.59 QPen Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
62.60 QColor Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
62.61 QPrinter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
62.62 QFont Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
62.63 QBrush Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
62.64 QByteArray Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
62.65 QIODevice Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
62.66 QAbstractSocket Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
62.67 QNetworkProxy Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
62.68 QTcpSocket Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
62.69 QTcpServer Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
62.70 QHostAddress Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
62.71 QHostInfo Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
62.72 QFileInfo Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
62.73 QDirModel Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
62.74 QFontDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
62.75 QDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
62.76 QTextCursor Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
62.77 QColorDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
62.78 QStringList Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
62.79 QKeySequence Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
62.80 QLCDNumber Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
62.81 QInputDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
62.82 QAllEvents Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
62.83 QDesktopWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
62.84 QRect Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
62.85 QTextDocument Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
62.86 QTextBlock Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
62.87 QTime Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
62.88 QListWidgetItem Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
62.89 QSystemTrayIcon Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
62.90 QDate Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
62.91 QTextCodec Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
62.92 QSqlDatabase Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
62.93 QSqlDriver Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
62.94 QSqlQuery Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
62.95 QSqlError Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
62.96 QSqlIndex Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
62.97 QSqlRecord Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
62.98 QSqlField Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
62.99 QSqlDriverCreatorBase Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
62.100QVariant Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
62.101QNetworkRequest Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
62.102QNetworkAccessManager Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
62.103QNetworkReply Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
62.104QPainterPath Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
62.105QImage Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
62.106RingCodeHighlighter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
62.107QXmlStreamReader Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
62.108QXmlStreamWriter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
62.109QXmlStreamNotationDeclaration Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
62.110QXmlStreamNamespaceDeclaration Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
xvii
62.111QXmlStreamEntityResolver Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
62.112QXmlStreamEntityDeclaration Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
62.113QXmlStreamAttributes Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
62.114QXmlStreamAttribute Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
62.115QThread Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
62.116QThreadPool Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
62.117QRegularExpression Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
62.118QRegularExpressionMatch Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
62.119QRegularExpressionMatchIterator Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
62.120QJsonArray Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
62.121QJsonDocument Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
62.122QJsonObject Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
62.123QJsonParseError Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
62.124QJsonValue Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
62.125QPlainTextEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
62.126QGridLayout Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
62.127QTextCharFormat Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
62.128QCameraViewfinder Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
62.129QGraphicsVideoItem Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
62.130QVideoWidgetControl Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
62.131QCamera Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
62.132QCameraImageCapture Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
62.133QMediaObject Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
62.134QHeaderView Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735
62.135QFontMetrics Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
62.136QSplashScreen Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
62.137QBoxLayout Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
62.138QLayout Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
62.139QLinearGradient Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
62.140QGradient Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
62.141QPointF Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
62.142QPoint Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
63 Frequently Asked Questions (FAQ) 742
63.1 Why do we need Yet Another Programming Language (YAPL)? . . . . . . . . . . . . . . . . . . . . 742
63.2 Why Ring is weakly typed? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
63.3 What are the advantages to using Ring over Lisp or Smalltalk? . . . . . . . . . . . . . . . . . . . . . 743
63.4 Why Ring is largely focussed on UI creation? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
63.5 Is Ring some sort of improvement over PHP? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
63.6 What are the advantages to using Ring over native C or C++? . . . . . . . . . . . . . . . . . . . . . 744
63.7 What is the difference between Ring and Python? And is Ring Open Source? . . . . . . . . . . . . . 744
63.8 What are the advantages to using Ring over Perl, PHP, Python or Ruby? . . . . . . . . . . . . . . . . 745
63.9 What are the advantages to using Ring over Tcl or Lua? . . . . . . . . . . . . . . . . . . . . . . . . 746
63.10 What are the advantages to using Ring over C# or Java? . . . . . . . . . . . . . . . . . . . . . . . . 746
63.11 The documentation says functional programming is supported, but then this happens? . . . . . . . . 746
63.12 Why the ability to define your own languages Instead of just handing over the syntax so you can parse
it using whatever code you like? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747
63.13 Why you can specify the number of loops you want to break out of? . . . . . . . . . . . . . . . . . . 747
63.14 Why Ring uses ‘See’, ‘Give’, ‘But’ and ‘Ok’ Keywords? . . . . . . . . . . . . . . . . . . . . . . . . 747
63.15 What is the philosophy behind data types in Ring? . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
63.16 What about the Boolean values in Ring? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
63.17 What is the goal of including the “Main” function in Ring? . . . . . . . . . . . . . . . . . . . . . . . 749
63.18 Why the list index start from 1 in Ring? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
63.19 Is there constructor methods in Ring? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
xviii

Contenu connexe

Tendances

The Ring programming language version 1.5.4 book - Part 2 of 185
The Ring programming language version 1.5.4 book - Part 2 of 185The Ring programming language version 1.5.4 book - Part 2 of 185
The Ring programming language version 1.5.4 book - Part 2 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 2 of 189
The Ring programming language version 1.6 book - Part 2 of 189The Ring programming language version 1.6 book - Part 2 of 189
The Ring programming language version 1.6 book - Part 2 of 189Mahmoud Samir Fayed
 
Architectures logicielles et materielles
Architectures logicielles et materiellesArchitectures logicielles et materielles
Architectures logicielles et materiellesAdnane Farid
 
The Ring programming language version 1.7 book - Part 3 of 196
The Ring programming language version 1.7 book - Part 3 of 196The Ring programming language version 1.7 book - Part 3 of 196
The Ring programming language version 1.7 book - Part 3 of 196Mahmoud Samir Fayed
 
Manuel en Français LT 4000 series Hmi Hybride, écran Tactile pour affichage e...
Manuel en Français LT 4000 series Hmi Hybride, écran Tactile pour affichage e...Manuel en Français LT 4000 series Hmi Hybride, écran Tactile pour affichage e...
Manuel en Français LT 4000 series Hmi Hybride, écran Tactile pour affichage e...Pro-Face by Schneider Electric France
 
The Ring programming language version 1.8 book - Part 3 of 202
The Ring programming language version 1.8 book - Part 3 of 202The Ring programming language version 1.8 book - Part 3 of 202
The Ring programming language version 1.8 book - Part 3 of 202Mahmoud Samir Fayed
 
Liste instruction
Liste instructionListe instruction
Liste instructionAli Fsahi
 
The Ring programming language version 1.10 book - Part 3 of 212
The Ring programming language version 1.10 book - Part 3 of 212The Ring programming language version 1.10 book - Part 3 of 212
The Ring programming language version 1.10 book - Part 3 of 212Mahmoud Samir Fayed
 
Sout3
Sout3Sout3
Sout33on
 

Tendances (20)

Cours matlab
Cours matlabCours matlab
Cours matlab
 
The Ring programming language version 1.5.4 book - Part 2 of 185
The Ring programming language version 1.5.4 book - Part 2 of 185The Ring programming language version 1.5.4 book - Part 2 of 185
The Ring programming language version 1.5.4 book - Part 2 of 185
 
The Ring programming language version 1.6 book - Part 2 of 189
The Ring programming language version 1.6 book - Part 2 of 189The Ring programming language version 1.6 book - Part 2 of 189
The Ring programming language version 1.6 book - Part 2 of 189
 
Architectures logicielles et materielles
Architectures logicielles et materiellesArchitectures logicielles et materielles
Architectures logicielles et materielles
 
The Ring programming language version 1.7 book - Part 3 of 196
The Ring programming language version 1.7 book - Part 3 of 196The Ring programming language version 1.7 book - Part 3 of 196
The Ring programming language version 1.7 book - Part 3 of 196
 
Manuel en Français LT 4000 series Hmi Hybride, écran Tactile pour affichage e...
Manuel en Français LT 4000 series Hmi Hybride, écran Tactile pour affichage e...Manuel en Français LT 4000 series Hmi Hybride, écran Tactile pour affichage e...
Manuel en Français LT 4000 series Hmi Hybride, écran Tactile pour affichage e...
 
Bedhboperation r41 fr
Bedhboperation r41 frBedhboperation r41 fr
Bedhboperation r41 fr
 
The Ring programming language version 1.8 book - Part 3 of 202
The Ring programming language version 1.8 book - Part 3 of 202The Ring programming language version 1.8 book - Part 3 of 202
The Ring programming language version 1.8 book - Part 3 of 202
 
Matlab for engineer
Matlab for engineer Matlab for engineer
Matlab for engineer
 
Report MyProof
Report MyProofReport MyProof
Report MyProof
 
doc
docdoc
doc
 
PMP Report
PMP ReportPMP Report
PMP Report
 
Rapport final
Rapport finalRapport final
Rapport final
 
Liste instruction
Liste instructionListe instruction
Liste instruction
 
Tp sgbd gsi
Tp sgbd gsiTp sgbd gsi
Tp sgbd gsi
 
Deviens un Ninja avec Angular2
Deviens un Ninja avec Angular2Deviens un Ninja avec Angular2
Deviens un Ninja avec Angular2
 
The Ring programming language version 1.10 book - Part 3 of 212
The Ring programming language version 1.10 book - Part 3 of 212The Ring programming language version 1.10 book - Part 3 of 212
The Ring programming language version 1.10 book - Part 3 of 212
 
Unity
UnityUnity
Unity
 
B1
B1B1
B1
 
Sout3
Sout3Sout3
Sout3
 

Similaire à The Ring programming language version 1.2 book - Part 2 of 84

Automatisme) www.cours-online.com
Automatisme) www.cours-online.comAutomatisme) www.cours-online.com
Automatisme) www.cours-online.commorin moli
 
Introduction aux systèmes automatisés
Introduction aux systèmes automatisésIntroduction aux systèmes automatisés
Introduction aux systèmes automatisésmorin moli
 
LatexPourLeProfDeMaths.pdf
LatexPourLeProfDeMaths.pdfLatexPourLeProfDeMaths.pdf
LatexPourLeProfDeMaths.pdfWafaa Ibrihich
 
Base-de-données.pdf
Base-de-données.pdfBase-de-données.pdf
Base-de-données.pdfdjallel2
 
The Ring programming language version 1.8 book - Part 1 of 202
The Ring programming language version 1.8 book - Part 1 of 202The Ring programming language version 1.8 book - Part 1 of 202
The Ring programming language version 1.8 book - Part 1 of 202Mahmoud Samir Fayed
 
Manuel du module additionnel RF-LAMINATE pour RFEM
Manuel du module additionnel RF-LAMINATE pour RFEMManuel du module additionnel RF-LAMINATE pour RFEM
Manuel du module additionnel RF-LAMINATE pour RFEMGrégoire Dupont
 
The Ring programming language version 1.10 book - Part 1 of 212
The Ring programming language version 1.10 book - Part 1 of 212The Ring programming language version 1.10 book - Part 1 of 212
The Ring programming language version 1.10 book - Part 1 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 1 of 210
The Ring programming language version 1.9 book - Part 1 of 210The Ring programming language version 1.9 book - Part 1 of 210
The Ring programming language version 1.9 book - Part 1 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.4.1 book - Part 1 of 31
The Ring programming language version 1.4.1 book - Part 1 of 31The Ring programming language version 1.4.1 book - Part 1 of 31
The Ring programming language version 1.4.1 book - Part 1 of 31Mahmoud Samir Fayed
 
matrices mpsi classe préparatoire
matrices mpsi classe préparatoire matrices mpsi classe préparatoire
matrices mpsi classe préparatoire Chesnel La Logique
 
The Ring programming language version 1.4 book - Part 1 of 30
The Ring programming language version 1.4 book - Part 1 of 30The Ring programming language version 1.4 book - Part 1 of 30
The Ring programming language version 1.4 book - Part 1 of 30Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 1 of 181
The Ring programming language version 1.5.2 book - Part 1 of 181The Ring programming language version 1.5.2 book - Part 1 of 181
The Ring programming language version 1.5.2 book - Part 1 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 1 of 196
The Ring programming language version 1.7 book - Part 1 of 196The Ring programming language version 1.7 book - Part 1 of 196
The Ring programming language version 1.7 book - Part 1 of 196Mahmoud Samir Fayed
 
courspython3.pdf
courspython3.pdfcourspython3.pdf
courspython3.pdfDendouga1
 
The Ring programming language version 1.5.3 book - Part 1 of 184
The Ring programming language version 1.5.3 book - Part 1 of 184The Ring programming language version 1.5.3 book - Part 1 of 184
The Ring programming language version 1.5.3 book - Part 1 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 1 of 185
The Ring programming language version 1.5.4 book - Part 1 of 185The Ring programming language version 1.5.4 book - Part 1 of 185
The Ring programming language version 1.5.4 book - Part 1 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 1 of 189
The Ring programming language version 1.6 book - Part 1 of 189The Ring programming language version 1.6 book - Part 1 of 189
The Ring programming language version 1.6 book - Part 1 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 1 of 88
The Ring programming language version 1.3 book - Part 1 of 88The Ring programming language version 1.3 book - Part 1 of 88
The Ring programming language version 1.3 book - Part 1 of 88Mahmoud Samir Fayed
 

Similaire à The Ring programming language version 1.2 book - Part 2 of 84 (20)

Automatisme) www.cours-online.com
Automatisme) www.cours-online.comAutomatisme) www.cours-online.com
Automatisme) www.cours-online.com
 
Introduction aux systèmes automatisés
Introduction aux systèmes automatisésIntroduction aux systèmes automatisés
Introduction aux systèmes automatisés
 
LatexPourLeProfDeMaths.pdf
LatexPourLeProfDeMaths.pdfLatexPourLeProfDeMaths.pdf
LatexPourLeProfDeMaths.pdf
 
Algo
AlgoAlgo
Algo
 
Base-de-données.pdf
Base-de-données.pdfBase-de-données.pdf
Base-de-données.pdf
 
Introduction à MATLAB
Introduction à MATLABIntroduction à MATLAB
Introduction à MATLAB
 
The Ring programming language version 1.8 book - Part 1 of 202
The Ring programming language version 1.8 book - Part 1 of 202The Ring programming language version 1.8 book - Part 1 of 202
The Ring programming language version 1.8 book - Part 1 of 202
 
Manuel du module additionnel RF-LAMINATE pour RFEM
Manuel du module additionnel RF-LAMINATE pour RFEMManuel du module additionnel RF-LAMINATE pour RFEM
Manuel du module additionnel RF-LAMINATE pour RFEM
 
The Ring programming language version 1.10 book - Part 1 of 212
The Ring programming language version 1.10 book - Part 1 of 212The Ring programming language version 1.10 book - Part 1 of 212
The Ring programming language version 1.10 book - Part 1 of 212
 
The Ring programming language version 1.9 book - Part 1 of 210
The Ring programming language version 1.9 book - Part 1 of 210The Ring programming language version 1.9 book - Part 1 of 210
The Ring programming language version 1.9 book - Part 1 of 210
 
The Ring programming language version 1.4.1 book - Part 1 of 31
The Ring programming language version 1.4.1 book - Part 1 of 31The Ring programming language version 1.4.1 book - Part 1 of 31
The Ring programming language version 1.4.1 book - Part 1 of 31
 
matrices mpsi classe préparatoire
matrices mpsi classe préparatoire matrices mpsi classe préparatoire
matrices mpsi classe préparatoire
 
The Ring programming language version 1.4 book - Part 1 of 30
The Ring programming language version 1.4 book - Part 1 of 30The Ring programming language version 1.4 book - Part 1 of 30
The Ring programming language version 1.4 book - Part 1 of 30
 
The Ring programming language version 1.5.2 book - Part 1 of 181
The Ring programming language version 1.5.2 book - Part 1 of 181The Ring programming language version 1.5.2 book - Part 1 of 181
The Ring programming language version 1.5.2 book - Part 1 of 181
 
The Ring programming language version 1.7 book - Part 1 of 196
The Ring programming language version 1.7 book - Part 1 of 196The Ring programming language version 1.7 book - Part 1 of 196
The Ring programming language version 1.7 book - Part 1 of 196
 
courspython3.pdf
courspython3.pdfcourspython3.pdf
courspython3.pdf
 
The Ring programming language version 1.5.3 book - Part 1 of 184
The Ring programming language version 1.5.3 book - Part 1 of 184The Ring programming language version 1.5.3 book - Part 1 of 184
The Ring programming language version 1.5.3 book - Part 1 of 184
 
The Ring programming language version 1.5.4 book - Part 1 of 185
The Ring programming language version 1.5.4 book - Part 1 of 185The Ring programming language version 1.5.4 book - Part 1 of 185
The Ring programming language version 1.5.4 book - Part 1 of 185
 
The Ring programming language version 1.6 book - Part 1 of 189
The Ring programming language version 1.6 book - Part 1 of 189The Ring programming language version 1.6 book - Part 1 of 189
The Ring programming language version 1.6 book - Part 1 of 189
 
The Ring programming language version 1.3 book - Part 1 of 88
The Ring programming language version 1.3 book - Part 1 of 88The Ring programming language version 1.3 book - Part 1 of 88
The Ring programming language version 1.3 book - Part 1 of 88
 

Plus de 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
 

Plus de 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
 

The Ring programming language version 1.2 book - Part 2 of 84

  • 1. 36.18 attributes() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 36.19 methods() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 36.20 isattribute() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 36.21 isprivateattribute() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 36.22 ismethod() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 36.23 isprivatemethod() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 36.24 addattribute() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 36.25 addmethod() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 36.26 getattribute() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 36.27 setattribute() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 36.28 mergemethods() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 37 Stdlib Functions 202 37.1 puts() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 37.2 print() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 37.3 getstring() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 37.4 getnumber() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 37.5 apppath() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 37.6 value() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 37.7 times() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 37.8 map() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 37.9 filter() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 37.10 split() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 37.11 newlist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 37.12 capitalized() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 37.13 isspecial() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 37.14 isvowel() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 37.15 linecount() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 37.16 factorial() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 37.17 fibonacci() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 37.18 isprime() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 37.19 sign() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 37.20 list2file() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 37.21 file2list() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 37.22 startswith() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 37.23 endswith() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 37.24 gcd() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 37.25 lcm() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 37.26 sumlist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 37.27 prodlist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 37.28 evenorodd() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 37.29 factors() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 37.30 palindrome() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 37.31 isleapyear() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 37.32 binarydigits() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 37.33 matrixmulti() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 37.34 matrixtrans() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 37.35 dayofweek() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 37.36 permutation() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 37.37 readline() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 37.38 substring() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 37.39 changestring() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 37.40 sleep() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 37.41 ismainsourcefile() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 ix
  • 2. 37.42 direxists() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 37.43 makedir() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 38 Stdlib Classes 216 38.1 StdBase Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 38.2 String Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 38.3 List Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 38.4 Stack Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 38.5 Queue Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 38.6 HashTable Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 38.7 Tree Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 38.8 Math Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 38.9 DateTime Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 38.10 File Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 38.11 System Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 38.12 Debug Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 38.13 DataType Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 38.14 Conversion Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 38.15 ODBC Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 38.16 MySQL Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 38.17 SQLite Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 38.18 Security Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 38.19 Internet Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 39 Declarative Programming using Nested Structures 239 39.1 Creating Objects inside Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 39.2 Composition and Returning Objects and Lists by Reference . . . . . . . . . . . . . . . . . . . . . . 240 39.3 Executing code after the end of object access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 39.4 Declarative Programming on the top of Object-Oriented . . . . . . . . . . . . . . . . . . . . . . . . 242 39.5 More beautiful Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 40 Natural Language Programming 245 40.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 40.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 40.3 Change the Ring Keyword ‘And’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 40.4 Change the Ring Operator ‘+’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 40.5 Change the ‘=’ operator to ‘is’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 40.6 Using Eval() with our Natural Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 40.7 BraceStart and BraceEnd Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 40.8 BraceExprEval Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 40.9 Real Natural Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 40.10 BraceError() Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 40.11 Clean Natural Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 41 Web Development (CGI Library) 255 41.1 Configure the Apache web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 41.2 Ring CGI Hello World Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 41.3 Hello World Program using the Web Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 41.4 Web Library Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 41.5 HTTP Get Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 41.6 HTTP POST Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 41.7 Upload Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 41.8 Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 41.9 URL Encode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 41.10 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 x
  • 3. 41.11 HTML Special Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 41.12 Hash Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 41.13 Random Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 41.14 HTML Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 41.15 HTML Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 41.16 Gradient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 41.17 Generating Pages using Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 41.18 Using Bootstrap Library using Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 41.19 Using Bootstrap Library using Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 41.20 CRUD Example using MVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 41.21 Users registration and Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 41.22 Database, ModelBase & ControllerBase classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 41.23 WebLib API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 41.24 Application Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 41.25 Page Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 41.26 ScriptFunctions Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 41.27 StyleFunctions Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 42 Using RingLibCurl 307 42.1 Get Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 42.2 Post Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 42.3 Facebook Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 42.4 Save Output to String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 43 Graphics and 2D Games programming using RingAllegro 310 43.1 Drawing, Animation and Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 43.2 Using TrueType Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 43.3 Playing Sound Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 43.4 Scaling and Rotating Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 43.5 Display Transparent Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 43.6 Using Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 44 Using RingLibSDL 323 44.1 Create Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 44.2 Display Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 44.3 Switch between two images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 44.4 Draw Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 44.5 Display PNG Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 44.6 Use TTF Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 44.7 Display Transparent Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 44.8 Close Window Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 44.9 Mouse Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 44.10 Play Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 45 Demo Project - Game Engine for 2D Games 330 45.1 Project Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 45.2 Graphics Library bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 45.3 Interface to graphics library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 45.4 Game Engine Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 45.5 Games Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 45.6 Game Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 45.7 GameObject Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 45.8 Sprite Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 45.9 Text Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 45.10 Animate Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 xi
  • 4. 45.11 Sound Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 45.12 Map Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 45.13 Using the Game Engine - Creating the Game Window . . . . . . . . . . . . . . . . . . . . . . . . . 335 45.14 Using the Game Engine - Drawing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 45.15 Using the Game Engine - Moving Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 45.16 Using the Game Engine - Playing Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 45.17 Using the Game Engine - Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 45.18 Using the Game Engine - Animation and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 45.19 Using the Game Engine - Sprite - Automatic Movement using Keyboard . . . . . . . . . . . . . . . 342 45.20 Using the Game Engine - Sprite - Keypress event . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 45.21 Using the Game Engine - Sprite - Mouse event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 45.22 Using the Game Engine - Sprite - State event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 45.23 Using the Game Engine - Animate - Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345 45.24 Using the Game Engine - Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 45.25 Using the Game Engine - Map Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 45.26 Using the Game Engine - Object and Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350 45.27 Stars Fighter Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353 45.28 Flappy Bird 3000 Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 45.29 Super Man 2016 Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 46 Building Games For Android 380 46.1 Download Requirements and Update the Android SDK . . . . . . . . . . . . . . . . . . . . . . . . . 380 46.2 Project Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 46.3 Building the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 47 Desktop and Mobile development using RingQt 383 47.1 The First GUI Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 47.2 Using Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 47.3 Using the QTextEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 47.4 Using the QListWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 47.5 Using QTreeView and QFileSystemModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 47.6 Using QTreeWidget and QTreeWidgetItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 47.7 Using QComboBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 47.8 Creating Menubar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 47.9 Creating Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 47.10 Creating StatusBar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 47.11 Using QDockWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 47.12 Using QTabWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 47.13 Using QTableWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 47.14 Using QProgressBar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402 47.15 Using QSpinBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 47.16 Using QSlider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 47.17 Using QDateEdit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 47.18 Using QDial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 47.19 Using QWebView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 47.20 Using QCheckBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410 47.21 Using QRadioButton and QButtonGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 47.22 Adding Hyperlink to QLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 47.23 QVideoWidget and QMediaPlayer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414 47.24 Using QFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 47.25 Display Image using QLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 47.26 Menubar and StyleSheet Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418 47.27 QLineEdit Events and QMessageBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420 47.28 Other Widgets Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 xii
  • 5. 47.29 Using the QTimer Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424 47.30 Using QProgressBar and Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425 47.31 Display Scaled Image using QLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426 47.32 Using the QFileDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 47.33 Drawing using QPainter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428 47.34 Printing using QPrinter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430 47.35 Creating More than one Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 47.36 Playing Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 47.37 Using the QColorDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 47.38 Using qLCDNumber Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 47.39 Movable Label Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 47.40 QMessagebox Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 47.41 Using QInputDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 47.42 KeyPress and Mouse Move Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 47.43 Moving Objects using the Mouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 47.44 Inheritance from GUI Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443 47.45 Using QDesktopWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 47.46 Rotate Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445 47.47 Change Focus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 47.48 Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 47.49 Simple Client and Server Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 47.50 Dynamic Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 47.51 Weight History Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 47.52 Notepad Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 47.53 The Cards Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 47.54 Classes and their Methods to use the default events . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 47.55 Methods to use Events with Events Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480 47.56 The Difference between Qt and RingQt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481 47.57 RingQt Classes and their Qt Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 48 Building RingQt Applications for Mobile 483 48.1 Download Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 48.2 Update the Android SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 48.3 Install Qt for Android . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 48.4 Comments about developing for Android using RingQt . . . . . . . . . . . . . . . . . . . . . . . . . 484 49 Objects Library for RingQt Application 486 49.1 Library Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486 49.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486 49.3 Objects Library Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489 50 Scope Rules for Variables and Attributes 492 50.1 Three Scopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492 50.2 Defining Variables and Variables Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492 50.3 How Ring find the variable? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 50.4 Using Object.Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 50.5 The Self Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 50.6 How Ring Define Variables and Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494 50.7 Conflict between Global Variables and Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . 494 50.8 Conflict between Class Attributes and Local Variables . . . . . . . . . . . . . . . . . . . . . . . . . 495 50.9 Using Braces to access objects inside Class Methods . . . . . . . . . . . . . . . . . . . . . . . . . . 496 50.10 Accessing the class attributes from braces inside class methods . . . . . . . . . . . . . . . . . . . . 499 50.11 Creating a Class for each Window in GUI applications . . . . . . . . . . . . . . . . . . . . . . . . . 500 50.12 Conflict between self inside braces and self in the class region . . . . . . . . . . . . . . . . . . . . . 501 xiii
  • 6. 50.13 Using braces to escape from the current object scope . . . . . . . . . . . . . . . . . . . . . . . . . . 504 50.14 Summary of Scope Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 51 Scope Rules for Functions and Methods 507 51.1 How Ring find the Functions and Methods? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 51.2 Example about Sharing Names between Functions and Methods . . . . . . . . . . . . . . . . . . . . 508 51.3 Calling a function sharing the name with a method in the current class . . . . . . . . . . . . . . . . . 509 52 Syntax Flexibility 511 52.1 Change Language Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511 52.2 Change Language Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512 52.3 Load Syntax Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513 52.4 Using “()” around the function parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514 52.5 Using Semi-colon after and between statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514 52.6 Using $ and @ in the start of the variable name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515 52.7 Using the ‘elseif’ keyword as ‘but’ in if statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 515 52.8 Using the ‘else’ keyword as ‘other’ in switch statement . . . . . . . . . . . . . . . . . . . . . . . . . 516 52.9 Using the ‘end’ keyword in different control structures . . . . . . . . . . . . . . . . . . . . . . . . . 516 52.10 Using braces to start and end different control structures . . . . . . . . . . . . . . . . . . . . . . . . 517 52.11 Using ‘put’ and ‘get’ as ‘see’ and ‘give’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 52.12 Using ‘case’ as ‘on’ in switch statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 52.13 Using ‘def’ as ‘func’ in functions/methods definition . . . . . . . . . . . . . . . . . . . . . . . . . . 519 53 Distributing Ring Applications 520 53.1 Distributing Applications for Microsoft Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520 53.2 Protecting the Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520 53.3 Creating Windows Installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 53.4 Using C/C++ Compiler and Linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 53.5 Distributing Applications and Games for Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 54 Command Line Options 522 54.1 Printing Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522 54.2 Printing Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 54.3 Printing Intermediate Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 54.4 Printing Final Intermediate Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 54.5 CGI Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 54.6 No Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 54.7 Printing Instruction Operation Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 54.8 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 54.9 Generate Object File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536 55 Low Level Functions 537 55.1 callgc() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537 55.2 varptr() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538 55.3 space() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538 55.4 nullpointer() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539 55.5 object2pointer() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539 55.6 pointer2object() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539 55.7 ptrcmp() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 55.8 ringvm_cfunctionslist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 55.9 ringvm_functionslist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 55.10 ringvm_classeslist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 55.11 ringvm_packageslist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542 55.12 ringvm_memorylist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 55.13 ringvm_calllist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545 xiv
  • 7. 55.14 ringvm_fileslist() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546 56 Extension using the C/C++ languages 547 56.1 ring_ext.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547 56.2 ring_ext.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547 56.3 Module Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 56.4 Function Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 56.5 Check Parameters Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 56.6 Display Error Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 56.7 Check Parameters Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 56.8 Get Parameters Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 56.9 Return Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 56.10 Function Prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 56.11 Sin() Function Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 56.12 Fopen() and Fclose() Functions Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 56.13 Ring API - List Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552 56.14 Ring API - String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554 56.15 MySQL_Columns() Function Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554 56.16 Dynamic/Shared Libraries (DLL/So) and LoadLib() function . . . . . . . . . . . . . . . . . . . . . 555 57 Embedding Ring Language in C/C++ Programs 557 57.1 Ring State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557 57.2 Ring State Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557 57.3 Ring State Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558 58 Code Generator for wrapping C/C++ Libraries 560 58.1 Using the tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560 58.2 Configuration file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560 58.3 Using the function prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560 58.4 Adding code to the generated code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562 58.5 Prefix for Functions Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562 58.6 Generate function to wrap structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562 58.7 Determine Structure Members Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563 58.8 Defining Contants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563 58.9 Register New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563 58.10 Writing comments in the configuration file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564 58.11 Executing code during code generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564 58.12 Enum and Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564 58.13 Filtering using Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565 58.14 Configuration file for the Allegro Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565 58.15 Threads Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566 58.16 Code Generator Rules for Wrapping C++ Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568 58.17 Using configuration file that wrap C++ Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568 58.18 Configuration file for the Qt Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568 58.19 Configuration Files Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578 59 RingLibCurl Functions Reference 579 60 RingAllegro Functions Reference 581 61 RingLibSDL Functions Reference 600 62 RingQt Classes Reference 616 62.1 QApp Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616 62.2 QTest Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616 xv
  • 8. 62.3 QObject Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616 62.4 QWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617 62.5 QLabel Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622 62.6 QPushButton Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 62.7 QBitmap Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624 62.8 QPixmap Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624 62.9 QIcon Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624 62.10 QSize Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625 62.11 QLineEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625 62.12 QVBoxLayout Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627 62.13 QHBoxLayout Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627 62.14 QTextEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627 62.15 QListWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630 62.16 QTreeView Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631 62.17 QDir Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633 62.18 QFileSystemModel Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633 62.19 QTreeWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635 62.20 QTreeWidgetItem Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637 62.21 QComboBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 62.22 QMenuBar Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640 62.23 QMenu Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641 62.24 QToolBar Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642 62.25 QMainWindow Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642 62.26 QStatusBar Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644 62.27 QDockWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644 62.28 QTabWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645 62.29 QTableWidgetItem Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646 62.30 QFrame Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647 62.31 QAbstractScrollArea Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648 62.32 QAbstractItemView Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648 62.33 QTableView Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650 62.34 QTableWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651 62.35 QProgressBar Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654 62.36 QSpinBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655 62.37 QAbstractSlider Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655 62.38 QSlider Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656 62.39 QDateEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657 62.40 QDateTimeEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657 62.41 QAbstractSpinBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658 62.42 QDial Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 62.43 QWebView Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660 62.44 QUrl Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661 62.45 QCheckBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662 62.46 QAbstractButton Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662 62.47 QRadioButton Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663 62.48 QButtonGroup Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664 62.49 QMediaPlayer Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664 62.50 QMediaPlaylist Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665 62.51 QVideoWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666 62.52 QAction Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666 62.53 QEvent Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668 62.54 QMessageBox Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668 62.55 QTimer Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669 62.56 QFileDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670 xvi
  • 9. 62.57 QPainter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671 62.58 QPicture Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674 62.59 QPen Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674 62.60 QColor Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675 62.61 QPrinter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677 62.62 QFont Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678 62.63 QBrush Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680 62.64 QByteArray Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681 62.65 QIODevice Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683 62.66 QAbstractSocket Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683 62.67 QNetworkProxy Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685 62.68 QTcpSocket Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686 62.69 QTcpServer Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686 62.70 QHostAddress Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687 62.71 QHostInfo Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687 62.72 QFileInfo Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688 62.73 QDirModel Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689 62.74 QFontDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690 62.75 QDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690 62.76 QTextCursor Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691 62.77 QColorDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693 62.78 QStringList Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693 62.79 QKeySequence Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694 62.80 QLCDNumber Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695 62.81 QInputDialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695 62.82 QAllEvents Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697 62.83 QDesktopWidget Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699 62.84 QRect Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699 62.85 QTextDocument Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701 62.86 QTextBlock Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703 62.87 QTime Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703 62.88 QListWidgetItem Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704 62.89 QSystemTrayIcon Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705 62.90 QDate Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706 62.91 QTextCodec Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706 62.92 QSqlDatabase Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 62.93 QSqlDriver Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708 62.94 QSqlQuery Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708 62.95 QSqlError Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709 62.96 QSqlIndex Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709 62.97 QSqlRecord Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710 62.98 QSqlField Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710 62.99 QSqlDriverCreatorBase Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711 62.100QVariant Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711 62.101QNetworkRequest Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713 62.102QNetworkAccessManager Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713 62.103QNetworkReply Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714 62.104QPainterPath Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714 62.105QImage Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716 62.106RingCodeHighlighter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717 62.107QXmlStreamReader Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717 62.108QXmlStreamWriter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719 62.109QXmlStreamNotationDeclaration Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 62.110QXmlStreamNamespaceDeclaration Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 xvii
  • 10. 62.111QXmlStreamEntityResolver Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721 62.112QXmlStreamEntityDeclaration Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721 62.113QXmlStreamAttributes Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721 62.114QXmlStreamAttribute Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721 62.115QThread Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722 62.116QThreadPool Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723 62.117QRegularExpression Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723 62.118QRegularExpressionMatch Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724 62.119QRegularExpressionMatchIterator Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724 62.120QJsonArray Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725 62.121QJsonDocument Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725 62.122QJsonObject Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726 62.123QJsonParseError Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726 62.124QJsonValue Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727 62.125QPlainTextEdit Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727 62.126QGridLayout Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730 62.127QTextCharFormat Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730 62.128QCameraViewfinder Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732 62.129QGraphicsVideoItem Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732 62.130QVideoWidgetControl Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733 62.131QCamera Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733 62.132QCameraImageCapture Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734 62.133QMediaObject Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734 62.134QHeaderView Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735 62.135QFontMetrics Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737 62.136QSplashScreen Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738 62.137QBoxLayout Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738 62.138QLayout Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 62.139QLinearGradient Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740 62.140QGradient Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740 62.141QPointF Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740 62.142QPoint Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741 63 Frequently Asked Questions (FAQ) 742 63.1 Why do we need Yet Another Programming Language (YAPL)? . . . . . . . . . . . . . . . . . . . . 742 63.2 Why Ring is weakly typed? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743 63.3 What are the advantages to using Ring over Lisp or Smalltalk? . . . . . . . . . . . . . . . . . . . . . 743 63.4 Why Ring is largely focussed on UI creation? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744 63.5 Is Ring some sort of improvement over PHP? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744 63.6 What are the advantages to using Ring over native C or C++? . . . . . . . . . . . . . . . . . . . . . 744 63.7 What is the difference between Ring and Python? And is Ring Open Source? . . . . . . . . . . . . . 744 63.8 What are the advantages to using Ring over Perl, PHP, Python or Ruby? . . . . . . . . . . . . . . . . 745 63.9 What are the advantages to using Ring over Tcl or Lua? . . . . . . . . . . . . . . . . . . . . . . . . 746 63.10 What are the advantages to using Ring over C# or Java? . . . . . . . . . . . . . . . . . . . . . . . . 746 63.11 The documentation says functional programming is supported, but then this happens? . . . . . . . . 746 63.12 Why the ability to define your own languages Instead of just handing over the syntax so you can parse it using whatever code you like? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747 63.13 Why you can specify the number of loops you want to break out of? . . . . . . . . . . . . . . . . . . 747 63.14 Why Ring uses ‘See’, ‘Give’, ‘But’ and ‘Ok’ Keywords? . . . . . . . . . . . . . . . . . . . . . . . . 747 63.15 What is the philosophy behind data types in Ring? . . . . . . . . . . . . . . . . . . . . . . . . . . . 748 63.16 What about the Boolean values in Ring? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748 63.17 What is the goal of including the “Main” function in Ring? . . . . . . . . . . . . . . . . . . . . . . . 749 63.18 Why the list index start from 1 in Ring? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750 63.19 Is there constructor methods in Ring? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750 xviii