Soumettre la recherche
Mettre en ligne
The Ring programming language version 1.8 book - Part 1 of 202
•
0 j'aime
•
691 vues
Mahmoud Samir Fayed
Suivre
The Ring programming language version 1.8 book - Part 1 of 202
Lire moins
Lire la suite
Logiciels
Signaler
Partager
Signaler
Partager
1 sur 10
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
The Ring programming language version 1.7 book - Part 1 of 196
The Ring programming language version 1.7 book - Part 1 of 196
Mahmoud Samir Fayed
The Ring programming language version 1.10 book - Part 1 of 212
The Ring programming language version 1.10 book - Part 1 of 212
Mahmoud 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 210
Mahmoud 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 189
Mahmoud 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 88
Mahmoud Samir Fayed
The Ring programming language version 1.4 book - Part 1 of 30
The Ring programming language version 1.4 book - Part 1 of 30
Mahmoud Samir Fayed
The Ring programming language version 1.2 book - Part 1 of 84
The Ring programming language version 1.2 book - Part 1 of 84
Mahmoud 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 31
Mahmoud Samir Fayed
Recommandé
The Ring programming language version 1.7 book - Part 1 of 196
The Ring programming language version 1.7 book - Part 1 of 196
Mahmoud Samir Fayed
The Ring programming language version 1.10 book - Part 1 of 212
The Ring programming language version 1.10 book - Part 1 of 212
Mahmoud 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 210
Mahmoud 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 189
Mahmoud 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 88
Mahmoud Samir Fayed
The Ring programming language version 1.4 book - Part 1 of 30
The Ring programming language version 1.4 book - Part 1 of 30
Mahmoud Samir Fayed
The Ring programming language version 1.2 book - Part 1 of 84
The Ring programming language version 1.2 book - Part 1 of 84
Mahmoud 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 31
Mahmoud 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 181
Mahmoud Samir Fayed
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 184
Mahmoud 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 185
Mahmoud Samir Fayed
The Ring programming language version 1.5.1 book - Part 1 of 180
The Ring programming language version 1.5.1 book - Part 1 of 180
Mahmoud Samir Fayed
Support formation vidéo : Excel 2016 - Maîtrisez les bases
Support formation vidéo : Excel 2016 - Maîtrisez les bases
SmartnSkilled
Lavorare con java 6
Lavorare con java 6
Pi Libri
Support formation vidéo : Word 2016 - Maîriser les bases
Support formation vidéo : Word 2016 - Maîriser les bases
SmartnSkilled
Tp sgbd gsi
Tp sgbd gsi
saqrjareh
Support formation vidéo: PowerPoint 2016 - Maîtriser les bases
Support formation vidéo: PowerPoint 2016 - Maîtriser les bases
SmartnSkilled
Deviens un Ninja avec Angular2
Deviens un Ninja avec Angular2
Gantner Technologies
Eripm wd bgt0000 nbk
Eripm wd bgt0000 nbk
Sprl Eripm
initiation-au-langage-c-et-exercices-corriges
initiation-au-langage-c-et-exercices-corriges
jojo sekkat
Programmation en-java-api
Programmation en-java-api
Aissam エサム Afifi アフフ
Description open erp_v_7
Description open erp_v_7
Ab Rafaoui
Livre blanc de J2ME
Livre blanc de J2ME
Bruno Delb
La base de données Oracle
La base de données Oracle
Bruno Delb
Object detection and recognition in digital images
Object detection and recognition in digital images
Sakher BELOUADAH
Oracle 11g exploitation
Oracle 11g exploitation
Dieudonné M'sago
Etude E-marketing : Email mobile - maelle urban
Etude E-marketing : Email mobile - maelle urban
maelleurban
Deep Learning : Application à la reconnaissance d’objets de classes multiples...
Deep Learning : Application à la reconnaissance d’objets de classes multiples...
Haytam EL YOUSSFI
Base-de-données.pdf
Base-de-données.pdf
djallel2
courspython3.pdf
courspython3.pdf
Dendouga1
Contenu connexe
Tendances
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 181
Mahmoud Samir Fayed
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 184
Mahmoud 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 185
Mahmoud Samir Fayed
The Ring programming language version 1.5.1 book - Part 1 of 180
The Ring programming language version 1.5.1 book - Part 1 of 180
Mahmoud Samir Fayed
Support formation vidéo : Excel 2016 - Maîtrisez les bases
Support formation vidéo : Excel 2016 - Maîtrisez les bases
SmartnSkilled
Lavorare con java 6
Lavorare con java 6
Pi Libri
Support formation vidéo : Word 2016 - Maîriser les bases
Support formation vidéo : Word 2016 - Maîriser les bases
SmartnSkilled
Tp sgbd gsi
Tp sgbd gsi
saqrjareh
Support formation vidéo: PowerPoint 2016 - Maîtriser les bases
Support formation vidéo: PowerPoint 2016 - Maîtriser les bases
SmartnSkilled
Deviens un Ninja avec Angular2
Deviens un Ninja avec Angular2
Gantner Technologies
Eripm wd bgt0000 nbk
Eripm wd bgt0000 nbk
Sprl Eripm
initiation-au-langage-c-et-exercices-corriges
initiation-au-langage-c-et-exercices-corriges
jojo sekkat
Programmation en-java-api
Programmation en-java-api
Aissam エサム Afifi アフフ
Description open erp_v_7
Description open erp_v_7
Ab Rafaoui
Livre blanc de J2ME
Livre blanc de J2ME
Bruno Delb
La base de données Oracle
La base de données Oracle
Bruno Delb
Object detection and recognition in digital images
Object detection and recognition in digital images
Sakher BELOUADAH
Oracle 11g exploitation
Oracle 11g exploitation
Dieudonné M'sago
Etude E-marketing : Email mobile - maelle urban
Etude E-marketing : Email mobile - maelle urban
maelleurban
Deep Learning : Application à la reconnaissance d’objets de classes multiples...
Deep Learning : Application à la reconnaissance d’objets de classes multiples...
Haytam EL YOUSSFI
Tendances
(20)
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 181
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 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 185
The Ring programming language version 1.5.1 book - Part 1 of 180
The Ring programming language version 1.5.1 book - Part 1 of 180
Support formation vidéo : Excel 2016 - Maîtrisez les bases
Support formation vidéo : Excel 2016 - Maîtrisez les bases
Lavorare con java 6
Lavorare con java 6
Support formation vidéo : Word 2016 - Maîriser les bases
Support formation vidéo : Word 2016 - Maîriser les bases
Tp sgbd gsi
Tp sgbd gsi
Support formation vidéo: PowerPoint 2016 - Maîtriser les bases
Support formation vidéo: PowerPoint 2016 - Maîtriser les bases
Deviens un Ninja avec Angular2
Deviens un Ninja avec Angular2
Eripm wd bgt0000 nbk
Eripm wd bgt0000 nbk
initiation-au-langage-c-et-exercices-corriges
initiation-au-langage-c-et-exercices-corriges
Programmation en-java-api
Programmation en-java-api
Description open erp_v_7
Description open erp_v_7
Livre blanc de J2ME
Livre blanc de J2ME
La base de données Oracle
La base de données Oracle
Object detection and recognition in digital images
Object detection and recognition in digital images
Oracle 11g exploitation
Oracle 11g exploitation
Etude E-marketing : Email mobile - maelle urban
Etude E-marketing : Email mobile - maelle urban
Deep Learning : Application à la reconnaissance d’objets de classes multiples...
Deep Learning : Application à la reconnaissance d’objets de classes multiples...
Similaire à The Ring programming language version 1.8 book - Part 1 of 202
Base-de-données.pdf
Base-de-données.pdf
djallel2
courspython3.pdf
courspython3.pdf
Dendouga1
Manuel du module additionnel RF-LAMINATE pour RFEM
Manuel du module additionnel RF-LAMINATE pour RFEM
Grégoire Dupont
cours_python.pdf
cours_python.pdf
Wafaa Ibrihich
Rapport de projet_de_fin_d__tudes__pfe__safwen (8)
Rapport de projet_de_fin_d__tudes__pfe__safwen (8)
safwenbenfredj
Poly
Poly
ali choukri
Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...
Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...
mouafekmazia
The Ring programming language version 1.9 book - Part 3 of 210
The Ring programming language version 1.9 book - Part 3 of 210
Mahmoud Samir Fayed
The Ring programming language version 1.8 book - Part 3 of 202
The Ring programming language version 1.8 book - Part 3 of 202
Mahmoud Samir Fayed
The Ring programming language version 1.10 book - Part 3 of 212
The Ring programming language version 1.10 book - Part 3 of 212
Mahmoud Samir Fayed
Cbdsys 2
Cbdsys 2
Syrine Chebili
Ibm spectrum archive enterprise edition
Ibm spectrum archive enterprise edition
Luciano Saia
Apache Web Server Index
Apache Web Server Index
webhostingguy
Algo
Algo
mickel iron
rapport_stage_TBLB.pdf
rapport_stage_TBLB.pdf
fatimazahrakherazi
LatexPourLeProfDeMaths.pdf
LatexPourLeProfDeMaths.pdf
Wafaa Ibrihich
Introduction á C-sharp
Introduction á C-sharp
medfa
Reseaux sans fil dans les pays en developpement
Reseaux sans fil dans les pays en developpement
mimanou
Bedhboperation r41 fr
Bedhboperation r41 fr
ben aissa chokri
réaliser une plateforme d’automatisation et de génération des rapports de test
réaliser une plateforme d’automatisation et de génération des rapports de test
ahmed oumezzine
Similaire à The Ring programming language version 1.8 book - Part 1 of 202
(20)
Base-de-données.pdf
Base-de-données.pdf
courspython3.pdf
courspython3.pdf
Manuel du module additionnel RF-LAMINATE pour RFEM
Manuel du module additionnel RF-LAMINATE pour RFEM
cours_python.pdf
cours_python.pdf
Rapport de projet_de_fin_d__tudes__pfe__safwen (8)
Rapport de projet_de_fin_d__tudes__pfe__safwen (8)
Poly
Poly
Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...
Rapport Projet De Fin D'étude de Conception et développement d’une applicatio...
The Ring programming language version 1.9 book - Part 3 of 210
The Ring programming language version 1.9 book - Part 3 of 210
The Ring programming language version 1.8 book - Part 3 of 202
The Ring programming language version 1.8 book - Part 3 of 202
The Ring programming language version 1.10 book - Part 3 of 212
The Ring programming language version 1.10 book - Part 3 of 212
Cbdsys 2
Cbdsys 2
Ibm spectrum archive enterprise edition
Ibm spectrum archive enterprise edition
Apache Web Server Index
Apache Web Server Index
Algo
Algo
rapport_stage_TBLB.pdf
rapport_stage_TBLB.pdf
LatexPourLeProfDeMaths.pdf
LatexPourLeProfDeMaths.pdf
Introduction á C-sharp
Introduction á C-sharp
Reseaux sans fil dans les pays en developpement
Reseaux sans fil dans les pays en developpement
Bedhboperation r41 fr
Bedhboperation r41 fr
réaliser une plateforme d’automatisation et de génération des rapports de test
réaliser une plateforme d’automatisation et de génération des rapports de test
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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
Mahmoud 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 212
The 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 212
The 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 212
The 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 212
The 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 212
The 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 212
The 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 212
The 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 212
The 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 212
The 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 212
The 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.8 book - Part 1 of 202
1.
2.
Ring Documentation Release 1.8 Ring
Team June 25, 2018
3.
CONTENTS 1 Applications developed
in little hours 1 1.1 Quotes about Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 FetchStockData Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 Fifteen Puzzle Game 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.4 Google API Shortener Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.5 Analog Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.6 TicTacToe Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.7 Squares Puzzle Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.8 Video-Music-Player Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.9 Calculator Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.10 Windows StartUp Manager Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.11 Werdy Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.12 Samples in this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.13 Innovative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.14 Practical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2 Introduction 23 2.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2 Ring and other languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.3 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.4 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.5 License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3 Language Design 29 3.1 Why Ring? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.2 Designed for a Clear Goal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.3 Simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.4 Trying to be natural . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.5 Encourage Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.6 Compact Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.7 Define Natural Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.8 Define Declarative Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.9 Syntax Flexibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.10 Transparent Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.11 Visual Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.12 Smart Garbage Collector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.13 No Global Interpreter (VM) Lock - No GIL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.14 Fast Enough For Many Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4 What is new in Ring 1.8? 39 4.1 List of changes and new features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 i
4.
4.2 Better Performance
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.3 Find in files Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.4 String2Constant Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.5 StopWatch Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.6 More 3D Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.7 Compiling on Manjaro Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.8 Using This in the class region as Self . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4.9 Default value for object attributes is NULL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.10 The For Loops uses the local scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.11 Merge binary characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4.12 FoxRing Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 4.13 Better Form Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 4.14 Better Cards Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.15 Better RingQt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.16 Better Code Generator For Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.17 Better Ring Compiler and VM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.18 Notes to extensions creators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5 What is new in Ring 1.7? 52 5.1 List of changes and new features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.2 New Command: Load Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.3 ringvm_see() and ringvm_give() functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.4 ring_state_new() and ring_state_mainfile() functions . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.5 Better Trace Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.6 Better Ring Notepad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.7 Better RingQt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.8 Better Ring2EXE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.9 Better RingZip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.10 Better Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.11 Better Ring VM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.12 RingLibuv Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 6 What is new in Ring 1.6? 60 6.1 List of changes and new features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.2 Employee Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.3 New Tool: Ring2EXE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.4 Better Ring For Android . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.5 New Tool: Folder2qrc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.6 Better Scripts for building Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.7 RingConsoleColors Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.8 RingMurmurHash Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.9 Better Ring Notepad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.10 Better RingQt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 6.11 Better StdLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.12 Better RingVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.13 Better RingREPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.14 Using Tab instead of char(9) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.15 Using CR as Carriage return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.16 Using the ! operator as not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.17 Using && and || operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.18 Using ? to print expression then new line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 7 What is new in Ring 1.5? 71 7.1 List of changes and new features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 ii
5.
7.2 Video-Music-Player Application
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 7.3 Windows StartUp Manager Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.4 Calculator Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 7.5 Better Ring Notepad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 7.6 Better StdLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 7.7 Better WebLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 7.8 Better RingQt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 7.9 Better Objects Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7.10 RingFreeGLUT Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7.11 RingOpenGL Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 7.12 Better Code Generator for Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 7.13 Better Documentation Generator for Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 7.14 Ring VM - Tracing Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 7.15 Trace Library and Interactive Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 7.16 More Syntax Flexibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 7.17 Type Hints Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 7.18 Better Quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 7.19 What is new in Ring 1.5.1? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 7.20 What is new in Ring 1.5.2? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 7.21 What is new in Ring 1.5.3? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 7.22 What is new in Ring 1.5.4? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 8 What is new in Ring 1.4? 115 8.1 List of changes and new features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 8.2 Change: Basic Extensions are separated from RingVM . . . . . . . . . . . . . . . . . . . . . . . . . 115 8.3 The Natural Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 8.4 New Style is added to Ring Notepad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 8.5 RingREPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 8.6 Convert between Numbers and Bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 8.7 Better StdLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 8.8 Better WebLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 8.9 Better RingQt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 8.10 Qt Class Convertor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 8.11 What is new in Ring 1.4.1? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 9 What is new in Ring 1.3? 127 9.1 List of changes and new features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 9.2 Better RingQt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 9.3 Better Ring Notepad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 9.4 Ring mode for Emacs Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 9.5 Better StdLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 9.6 Better Loop|Exit Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 9.7 New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 9.8 Return Self by Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 9.9 Using ‘<’ and ‘:’ operators as ‘from’ keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 9.10 Embedding Ring in Ring without sharing the State . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 9.11 RingZip Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 9.12 Form Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 10 What is new in Ring 1.2? 140 10.1 List of changes and new features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 10.2 New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 10.3 Better Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 10.4 Better Ring Notepad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 iii
6.
10.5 Better RingQt
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 10.6 Objects Library for RingQt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 10.7 RingLibCurl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 10.8 Better Call Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 10.9 Using NULL instead of NULLPointer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 10.10 Display Warnings Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 10.11 Better Quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 11 What is new in Ring 1.1? 146 11.1 List of changes and new features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 11.2 Better Natural Language Programming Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 11.3 Generate/Execute Ring Object Files (*.ringo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 11.4 Syntax Flexibility and different styles for I/O and Control Structures . . . . . . . . . . . . . . . . . . 147 11.5 New Functions and Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 11.6 StdLib functions and classes written in Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 11.7 RingLibSDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 11.8 Demo Project - Game Engine for 2D Games . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 11.9 RingSQLite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 11.10 Better Code Generator for Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 11.11 Using Self.Attribute in the Class Region to define new attributes . . . . . . . . . . . . . . . . . . . . 154 11.12 Using This.Attribute in nested Braces inside the Class Methods . . . . . . . . . . . . . . . . . . . . 154 11.13 Better Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 12 Building From Source Code 156 12.1 Building using Microsoft Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 12.2 Building using Ubuntu Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 12.3 Building using Fedora Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 12.4 Building using MacOS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 12.5 Building using CMake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 13 How to contribute? 165 13.1 Special thanks to contributors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 13.2 Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 13.3 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 13.4 Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 13.5 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 13.6 Editors Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 13.7 Libraries in Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 13.8 Extensions in C/C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 13.9 Compiler and Virtual Machine (VM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 13.10 Ideas and suggestions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 14 Getting Started - First Style 167 14.1 Hello World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 14.2 Run the program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 14.3 Create Executable File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 14.4 Not Case-Sensitive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 14.5 Multi-Line literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 14.6 Getting Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 14.7 No Explicit End For Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 14.8 Using ? to print expression then new line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 14.9 Writing Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 15 Getting Started - Second Style 170 15.1 Hello World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 iv
7.
15.2 Run the
program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 15.3 Create Executable File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 15.4 Not Case-Sensitive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 15.5 Multi-Line literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 15.6 Getting Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 15.7 No Explicit End For Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 15.8 Writing Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 16 Getting Started - Third Style 172 16.1 Hello World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 16.2 Run the program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 16.3 Create Executable File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 16.4 Not Case-Sensitive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 16.5 Multi-Line literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 16.6 Getting Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 16.7 No Explicit End For Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 16.8 Writing Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 17 Using Ring Notepad 175 17.1 Ring Notepad - Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 17.2 Creating and running your first Console Application . . . . . . . . . . . . . . . . . . . . . . . . . . 176 17.3 Creating and running your first GUI/Mobile Application . . . . . . . . . . . . . . . . . . . . . . . . 178 17.4 Creating and running your first Web Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 17.5 Creating and running your first Desktop/Mobile Game . . . . . . . . . . . . . . . . . . . . . . . . . 181 17.6 The Main File in the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 17.7 The File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 17.8 The Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 17.9 The View Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 17.10 The Program Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 17.11 The Browser Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 17.12 The Tools Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 17.13 The Distribute Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 17.14 The Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 18 Using Other Code Editors 189 18.1 Using Notepad++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 18.2 Using Geany . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 18.3 Using Atom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 18.4 Using Sublime Text 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 18.5 Using Visual Studio IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 18.6 Using Emacs Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 19 Variables 195 19.1 Dynamic Typing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 19.2 Deep Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 19.3 Weakly Typed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 20 Operators 197 20.1 Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 20.2 Relational Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 20.3 Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 20.4 Bitwise Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 20.5 Assignment Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 20.6 Misc Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 20.7 Operators Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 v
8.
21 Control Structures
- First Style 200 21.1 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 21.2 Looping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 21.3 Using The Step option with For in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 21.4 Using For in to modify lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 21.5 Do Again Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 21.6 Exit Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 21.7 Exit from two loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 21.8 Loop Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 21.9 Exit/Loop inside sub functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 21.10 Short-circuit evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 21.11 Comments about evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 22 Control Structures - Second Style 207 22.1 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 22.2 Looping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 22.3 Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 23 Control Structures - Third Style 210 23.1 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 23.2 Looping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 23.3 Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 24 Getting Input 215 24.1 Give Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 24.2 GetChar() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 24.3 Input() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 25 Functions - First Style 217 25.1 Define Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 25.2 Call Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 25.3 Declare parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 25.4 Send Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 25.5 Main Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 25.6 Variables Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 25.7 Return Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 25.8 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 26 Functions - Second Style 221 26.1 Define Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 26.2 Call Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 26.3 Declare parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 26.4 Send Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 26.5 Main Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 26.6 Variables Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 26.7 Return Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 26.8 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 27 Functions - Third Style 225 27.1 Define Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 27.2 Call Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 27.3 Declare parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 27.4 Send Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 27.5 Main Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 27.6 Variables Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 vi
9.
27.7 Return Value
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 27.8 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 28 Program Structure 229 28.1 Source Code File Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 28.2 Using Many Source Code Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 28.3 Load Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 29 Lists 231 29.1 Create Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 29.2 Add Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 29.3 Get List Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 29.4 Delete Item From List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 29.5 Get List Item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 29.6 Set List Item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 29.7 Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 29.8 Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 29.9 Reverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 29.10 Insert Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 29.11 Nested Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 29.12 Copy Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 29.13 First-class lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 29.14 Using Lists during definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 29.15 Passing Lists to Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 29.16 Access List Items by String Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 29.17 Passing Parameters or Argumnents Using List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 29.18 Passing Parameters or Argumnents Using List Array . . . . . . . . . . . . . . . . . . . . . . . . . . 238 29.19 Creating a Multi-Dimensional Array using List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 29.20 Swap Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 30 Strings 241 30.1 String Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 30.2 Get String Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 30.3 Convert Letters Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 30.4 Access String Letters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 30.5 Left() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 30.6 Right() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 30.7 Trim() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 30.8 Copy() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 30.9 Lines() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 30.10 Substr() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 30.11 Find substring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 30.12 Get substring from position to end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 30.13 Get Number of Characters From Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 30.14 Transform Substring To Another Substring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 30.15 strcmp() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 30.16 str2list() and list2str() Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 30.17 Merge binary characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 31 Date and Time 248 31.1 Clock() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 31.2 ClocksPerSecond() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 31.3 Time() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 31.4 Date() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 31.5 TimeList() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 vii
10.
31.6 AddDays() Function
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 31.7 DiffDays() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 31.8 EpochTime() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 32 Check Data Type and Conversion 252 32.1 Check Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 32.2 IsString() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 32.3 IsNumber() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 32.4 IsList() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 32.5 Type() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 32.6 IsNULL() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 32.7 Check Character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 32.8 IsAlNum() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 32.9 IsAlpha() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 32.10 IsCntrl() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 32.11 IsDigit() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 32.12 IsGraph() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 32.13 IsLower() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 32.14 IsPrint() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 32.15 IsPunct() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 32.16 IsSpace() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 32.17 IsUpper() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 32.18 IsXdigit() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 32.19 Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 32.20 Number() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 32.21 String() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 32.22 Ascii() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 32.23 Char() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 32.24 Hex() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 32.25 Dec() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 32.26 Str2hex() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 32.27 Hex2str() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 33 Mathematical Functions 260 33.1 List of functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 33.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 33.3 Random() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 33.4 Unsigned() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 33.5 Decimals() Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 33.6 Using _ in numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 33.7 Using f after numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 34 Files 265 34.1 Read() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 34.2 Write() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 34.3 Dir() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 34.4 Rename() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 34.5 Remove() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 34.6 Fopen() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 34.7 Fclose() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 34.8 Fflush() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 34.9 Freopen() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 34.10 Tempfile() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 34.11 Tempname() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 viii
Télécharger maintenant