Welcome to Ring’s documentation!¶
Contents:
- Applications developed in little hours
 - Introduction
 - Language Design
 - What is new in Ring 1.1?
- List of changes and new features
 - Better Natural Language Programming Support
 - Generate/Execute Ring Object Files (*.ringo)
 - Syntax Flexibility and different styles for I/O and Control Structures
 - New Functions and Changes
 - StdLib functions and classes written in Ring
 - RingLibSDL
 - Demo Project - Game Engine for 2D Games
 - RingSQLite
 - Better Code Generator for Extensions
 - Using Self.Attribute in the Class Region to define new attributes
 - Using This.Attribute in nested Braces inside the Class Methods
 - Better Documentation
 
 - Building From Source Code
 - How to contribute?
 - Getting Started - First Style
 - Getting Started - Second Style
 - Getting Started - Third Style
 - Using Ring Notepad
 - Using Other Code Editors
 - Variables
 - Operators
 - Control Structures - First Style
 - Control Structures - Second Style
 - Control Structures - Third Style
 - Getting Input
 - Functions
 - Program Structure
 - Lists
 - Strings
- String Literals
 - Get String Length
 - Convert Letters Case
 - Access String Letters
 - Left() Function
 - Right() Function
 - Trim() Function
 - Copy() Function
 - Lines() Function
 - Substr() Function
 - Find substring
 - Get substring from position to end
 - Get Number of Characters From Position
 - Transform Substring To Another Substring
 - strcmp() Function
 - str2list() and list2str() Functions
 
 - Date and Time
 - Check Data Type and Conversion
- Check Data Type
 - IsString() Function
 - IsNumber() Function
 - IsList() Function
 - Type() Function
 - IsNULL() Function
 - Check Character
 - IsAlNum() Function
 - IsAlpha() Function
 - IsCntrl() Function
 - IsDigit() Function
 - IsGraph() Function
 - IsLower() Function
 - IsPrint() Function
 - IsPunct() Function
 - IsSpace() Function
 - IsUpper() Function
 - IsXdigit() Function
 - Conversion
 - Number() Function
 - String() Function
 - Ascii() Function
 - Char() Function
 - Hex() Function
 - Dec() Function
 - Str2hex() Function
 - Hex2str() Function
 
 - Mathematical Functions
 - Files
- Read() Function
 - Write() Function
 - Dir() Function
 - Rename() Function
 - Remove() Function
 - Fopen() Function
 - Fclose() Function
 - Fflush() Function
 - Freopen() Function
 - Tempfile() Function
 - Tempname() Function
 - Fseek() Function
 - Ftell() Function
 - Rewind() Function
 - Fgetpos() Function
 - Fsetpos() Function
 - Clearerr() Function
 - Feof() Function
 - Ferror() Function
 - Perror() Function
 - Fgetc() Function
 - Fgets() Function
 - Fputc() Function
 - Fputs() Function
 - Ungetc() Function
 - Fread() Function
 - Fwrite() Function
 - Fexists() Function
 - Example
 
 - System Functions
- System() Function
 - SysGet() Function
 - IsMSDOS() Function
 - IsWindows() Function
 - IsWindows64() Function
 - IsUnix() Function
 - IsMacOSX() Function
 - IsLinux() Function
 - IsFreeBSD() Function
 - IsAndroid() Function
 - Example
 - Windowsnl() Function
 - Get Command Line Arguments
 - Get Active Source File Name
 - CurrentDir() Function
 - ExeFileName() Function
 - ChDir() Function
 - ExeFolder() Function
 
 - Eval() and Debugging
 - Demo Programs
 - ODBC Functions
- odbc_init() Function
 - odbc_drivers() Function
 - odbc_datasources() Function
 - odbc_close() Function
 - Print List of ODBC Drivers
 - Print List of ODBC Data Sources
 - odbc_connect() Function
 - odbc_disconnect() Function
 - Open and Close Connection
 - odbc_execute() Function
 - odbc_colcount() Function
 - odbc_fetch() Function
 - odbc_getdata() Function
 - Execute Query and Print Result
 - odbc_tables() Function
 - odbc_columns() Function
 - odbc_autocommit() Function
 - odbc_commit() Function
 - odbc_rollback() Function
 - Transactions and Using Commit and Rollback
 - Save and Restore images
 
 - MySQL Functions
- MySQL_Info() Function
 - MySQL_Init() Function
 - MySQL_Error() Function
 - MySQL_Connect() Function
 - MySQL_Close() Function
 - MySQL_Query() Function
 - Create Database
 - Create Table and Insert Data
 - MySQL_Insert_ID() Function
 - MySQL_Result() Function
 - MySQL_Next_Result() Function
 - Print Query Result
 - MySQL_Columns() Function
 - MySQL_Result2() Function
 - MySQL_Escape_String() Function
 - Save Image inside the database
 - Restore Image From The Database
 - MySQL_AutoCommit() Function
 - MySQL_Commit() Function
 - MySQL_Rollback() Function
 - Transaction Example
 
 - SQLite Functions
 - Security and Internet Functions
 - Object Oriented Programming (OOP)
- Classes and Objects
 - Access Objects Using Braces
 - Composition
 - Setter and Getter
 - Private Attributes and Methods
 - Operator Overloading
 - Inheritance
 - Dynamic Attributes
 - Packages
 - Printing Objects
 - Find() and List of Objects
 - Sort() and list of objects
 - Using Self.Attribute and Self.Method()
 - Using This.Attribute and This.Method()
 
 - Functional Programming (FP)
 - Reflection and Meta-programming
- locals() Function
 - globals() Function
 - functions() Function
 - cfunctions() Function
 - islocal() Function
 - isglobal() Function
 - isfunction() Function
 - iscfunction() Function
 - packages() Function
 - ispackage() Function
 - classes() Function
 - isclass() Function
 - packageclasses() Function
 - ispackageclass() Function
 - classname() Function
 - objectid() Function
 - isobject() Function
 - attributes() Function
 - methods() Function
 - isattribute() Function
 - isprivateattribute() Function
 - ismethod() Function
 - isprivatemethod() Function
 - addattribute() Function
 - addmethod() Function
 - getattribute() function
 - setattribute() function
 - mergemethods() Function
 
 - Stdlib Functions
- puts() function
 - print() function
 - getstring() function
 - getnumber() function
 - apppath() function
 - value() function
 - times() function
 - map() function
 - filter() function
 - split() function
 - newlist() function
 - capitalized() function
 - isspecial() function
 - isvowel() function
 - linecount() function
 - factorial() function
 - fibonacci() function
 - isprime() function
 - sign() function
 - list2file() function
 - file2list() function
 - startswith() function
 - endswith() function
 - gcd() function
 - lcm() function
 - sumlist() function
 - prodlist() function
 - evenorodd() function
 - factors() function
 - palindrome() function
 - isleapyear() function
 - binarydigits() function
 - matrixmulti() function
 - matrixtrans() function
 - dayofweek() function
 - permutation() function
 - readline() function
 - substring() function
 - changestring() function
 - sleep() function
 - ismainsourcefile() function
 - direxists() function
 - makedir() function
 
 - Stdlib Classes
 - Declarative Programming using Nested Structures
 - Natural language programming
 - Web Development (CGI Library)
- Configure the Apache web server
 - Ring CGI Hello World Program
 - Hello World Program using the Web Library
 - Web Library Features
 - HTTP Get Example
 - HTTP POST Example
 - Upload Files
 - Cookies
 - URL Encode
 - Templates
 - HTML Special Characters
 - Hash Functions
 - Random Image
 - HTML Lists
 - HTML Tables
 - Gradient
 - Generating Pages using Objects
 - Using Bootstrap Library using Functions
 - Using Bootstrap Library using Objects
 - CRUD Example using MVC
 - Users registration and Login
 - Database, ModelBase & ControllerBase classes
 - WebLib API
 - Application Class
 - Page Class
 - ScriptFunctions Class
 - StyleFunctions Class
 
 - Graphics and 2D Games programming using RingAllegro
 - Using RingLibSDL
 - Demo Project - Game Engine for 2D Games
- Project Layers
 - Graphics Library bindings
 - Interface to graphics library
 - Game Engine Classes
 - Games Layer
 - Game Class
 - GameObject Class
 - Sprite Class
 - Text Class
 - Animate Class
 - Sound Class
 - Map Class
 - Using the Game Engine - Creating the Game Window
 - Using the Game Engine - Drawing Text
 - Using the Game Engine - Moving Text
 - Using the Game Engine - Playing Sound
 - Using the Game Engine - Animation
 - Using the Game Engine - Animation and Functions
 - Using the Game Engine - Sprite - Automatic Movement using Keyboard
 - Using the Game Engine - Sprite - Keypress event
 - Using the Game Engine - Sprite - Mouse event
 - Using the Game Engine - Sprite - State event
 - Using the Game Engine - Animate - Events
 - Using the Game Engine - Map
 - Using the Game Engine - Map Events
 - Using the Game Engine - Object and Drawing
 - Stars Fighter Game
 - Flappy Bird 3000 Game
 - Super Man 2016 Game
 
 - Building Games For Android
 - Desktop and Mobile development using RingQt
- The First GUI Application
 - Using Layout
 - Using the QTextEdit Class
 - Using the QListWidget Class
 - Using QTreeView and QFileSystemModel
 - Using QTreeWidget and QTreeWidgetItem
 - Using QComboBox Class
 - Creating Menubar
 - Creating Toolbar
 - Creating StatusBar
 - Using QDockWidget
 - Using QTabWidget
 - Using QTableWidget
 - Using QProgressBar
 - Using QSpinBox
 - Using QSlider
 - Using QDateEdit
 - Using QDial
 - Using QWebView
 - Using QCheckBox
 - Using QRadioButton and QButtonGroup
 - Adding Hyperlink to QLabel
 - QVideoWidget and QMediaPlayer
 - Using QFrame
 - Display Image using QLabel
 - Menubar and StyleSheet Example
 - QLineEdit Events and QMessageBox
 - Other Widgets Events
 - Using the QTimer Class
 - Using QProgressBar and Timer
 - Display Scaled Image using QLabel
 - Using the QFileDialog Class
 - Drawing using QPainter
 - Printing using QPrinter
 - Creating More than one Window
 - Playing Sound
 - Using the QColorDialog Class
 - Using qLCDNumber Class
 - Movable Label Example
 - QMessagebox Example
 - Using QInputDialog Class
 - KeyPress and Mouse Move Events
 - Moving Objects using the Mouse
 - Inheritance from GUI Classes
 - Using QDesktopWidget Class
 - Simple Client and Server Example
 - Dynamic Objects
 - Weight History Application
 - Notepad Application
 - The Cards Game
 - Classes and their Methods to use the default events
 - Methods to use Events with Events Filter
 - The Difference between Qt and RingQt
 - RingQt Classes and their Qt Documentation
 
 - Building RingQt Applications for Mobile
 - Scope Rules for Variables and Attributes
- Three Scopes
 - Defining Variables and Variables Access
 - How Ring find the variable?
 - Using Object.Attribute
 - The Self Object
 - How Ring Define Variables and Attributes
 - Conflict between Global Variables and Class Attributes
 - Conflict between Class Attributes and Local Variables
 - Using Braces to access objects inside Class Methods
 - Accessing the class attributes from braces inside class methods
 - Creating a Class for each Window in GUI applications
 - Conflict between self inside braces and self in the class region
 - Using braces to escape from the current object scope
 - Summary of Scope Rules
 
 - Scope Rules for Functions and Methods
 - Syntax Flexibility
- Change Language Keywords
 - Change Language Operators
 - Load Syntax Files
 - Using “()” around the function parameters
 - Using Semi-colon after and between statements
 - Using $ and @ in the start of the variable name
 - Using the ‘elseif’ keyword as ‘but’ in if statement
 - Using the ‘else’ keyword as ‘other’ in switch statement
 - Using the ‘end’ keyword in different control structures
 - Using braces to start and end different control structures
 - Using ‘put’ and ‘get’ as ‘see’ and ‘give’
 - Using ‘case’ as ‘on’ in switch statements
 - Using ‘def’ as ‘func’ in functions/methods definition
 
 - Distributing Ring Applications
 - Command Line Options
 - Low Level Functions
 - Extension using the C/C++ languages
- ring_ext.h
 - ring_ext.c
 - Module Organization
 - Function Structure
 - Check Parameters Count
 - Display Error Message
 - Check Parameters Type
 - Get Parameters Values
 - Return Value
 - Function Prototype
 - Sin() Function Implementation
 - Fopen() and Fclose() Functions Implementation
 - Ring API - List Functions
 - Ring API - String Functions
 - MySQL_Columns() Function Implementation
 - Dynamic/Shared Libraries (DLL/So) and LoadLib() function
 
 - Embedding Ring Language in C/C++ Programs
 - Code Generator for wrapping C/C++ Libraries
- Using the tool
 - Configuration file
 - Using the function prototype
 - Adding code to the generated code
 - Prefix for Functions Names
 - Generate function to wrap structures
 - Determine Structure Members Types
 - Defining Contants
 - Register New Functions
 - Writing comments in the configuration file
 - Executing code during code generation
 - Enum and Numbers
 - Filtering using Expressions
 - Configuration file for the Allegro Library
 - Threads Support
 - Code Generator Rules for Wrapping C++ Classes
 - Using configuration file that wrap C++ Library
 - Configuration file for the Qt Framework
 - Configuration Files Examples
 
 - RingAllegro Functions Reference
 - RingLibSDL Functions Reference
 - RingQt Classes and Methods Reference
- QApp Class
 - QTest Class
 - QObject Class
 - QWidget Class
 - QLabel Class
 - QPushButton Class
 - QBitmap Class
 - QPixmap Class
 - QIcon Class
 - QSize Class
 - QLineEdit Class
 - QVBoxLayout Class
 - QHBoxLayout Class
 - QTextEdit Class
 - QListWidget Class
 - QTreeView Class
 - QDir Class
 - QFileSystemModel Class
 - QTreeWidget Class
 - QTreeWidgetItem Class
 - QComboBox Class
 - QMenuBar Class
 - QMenu Class
 - QToolBar Class
 - QMainWindow Class
 - QStatusBar Class
 - QDockWidget Class
 - QTabWidget Class
 - QTableWidgetItem Class
 - QFrame Class
 - QAbstractScrollArea Class
 - QAbstractItemView Class
 - QTableView Class
 - QTableWidget Class
 - QProgressBar Class
 - QSpinBox Class
 - QAbstractSlider Class
 - QSlider Class
 - QDateEdit Class
 - QDateTimeEdit Class
 - QAbstractSpinBox Class
 - QDial Class
 - QWebView Class
 - QUrl Class
 - QCheckBox Class
 - QAbstractButton Class
 - QRadioButton Class
 - QButtonGroup Class
 - QMediaPlayer Class
 - QMediaPlaylist Class
 - QVideoWidget Class
 - QAction Class
 - QEvent Class
 - QMessageBox Class
 - QTimer Class
 - QFileDialog Class
 - QPainter Class
 - QPicture Class
 - QPen Class
 - QColor Class
 - QPrinter Class
 - QFont Class
 - QBrush Class
 - QByteArray Class
 - QIODevice Class
 - QAbstractSocket Class
 - QNetworkProxy Class
 - QTcpSocket Class
 - QTcpServer Class
 - QHostAddress Class
 - QHostInfo Class
 - QFileInfo Class
 - QDirModel Class
 - QFontDialog Class
 - QDialog Class
 - QTextCursor Class
 - QColorDialog Class
 - QStringList Class
 - QKeySequence Class
 - QLCDNumber Class
 - QInputDialog Class
 - QAllEvents Class
 - QDesktopWidget Class
 - QRect Class
 - QTextDocument Class
 - QTextBlock Class
 - QTime Class
 - QListWidgetItem Class
 - QSystemTrayIcon Class
 - QDate Class
 - QTextCodec Class
 - QSqlDatabase Class
 - QSqlDriver Class
 - QSqlQuery Class
 - QSqlError Class
 - QSqlIndex Class
 - QSqlRecord Class
 - QSqlField Class
 - QSqlDriverCreatorBase Class
 - QVariant Class
 - QNetworkRequest Class
 - QNetworkAccessManager Class
 - QNetworkReply Class
 - QPainterPath Class
 - QImage Class
 - RingCodeHighlighter Class
 - QXmlStreamReader Class
 - QXmlStreamWriter Class
 - QXmlStreamNotationDeclaration Class
 - QXmlStreamNamespaceDeclaration Class
 - QXmlStreamEntityResolver Class
 - QXmlStreamEntityDeclaration Class
 - QXmlStreamAttributes Class
 - QXmlStreamAttribute Class
 - QThread Class
 - QThreadPool Class
 - QRegularExpression Class
 - QRegularExpressionMatch Class
 - QRegularExpressionMatchIterator Class
 - QJsonArray Class
 - QJsonDocument Class
 - QJsonObject Class
 - QJsonParseError Class
 - QJsonValue Class
 - QPlainTextEdit Class
 - QGridLayout Class
 - QTextCharFormat Class
 - QCameraViewfinder Class
 - QGraphicsVideoItem Class
 - QVideoWidgetControl Class
 - QCamera Class
 - QCameraImageCapture Class
 - QMediaObject Class
 - QHeaderView Class
 - QFontMetrics Class
 - QSplashScreen Class
 - QBoxLayout Class
 - QLayout Class
 - QLinearGradient Class
 - QGradient Class
 - QPointF Class
 - QPoint Class
 
 - Frequently Asked Questions (FAQ)
- Why do we need Yet Another Programming Language (YAPL)?
 - Why Ring is weakly typed?
 - What are the advantages to using Ring over Lisp or Smalltalk?
 - Why Ring is largely focussed on UI creation?
 - Is Ring some sort of improvement over PHP?
 - What are the advantages to using Ring over native C or C++?
 - What is the difference between Ring and Python? And is Ring Open Source?
 - What are the advantages to using Ring over Perl, PHP, Python or Ruby?
 - What are the advantages to using Ring over Tcl or Lua?
 - What are the advantages to using Ring over C# or Java?
 - The documentation says functional programming is supported, but then this happens?
 - 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?
 - Why you can specify the number of loops you want to break out of?
 - Why Ring uses ‘See’, ‘Give’, ‘But’ and ‘Ok’ Keywords?
 - What is the philosophy behind data types in Ring?
 - What about the Boolean values in Ring?
 - What is the goal of including the “Main” function in Ring?
 - Why the list index start from 1 in Ring?
 - Is there constructor methods in Ring?
 - What happens when we create a new object?
 - Can we use the attributes by accessing the Getter and Setter methods?
 - Why should a search of global names be made while defining the class attributes?
 - Why Ring doesn’t avoid the conflict between Global Variables and Class Attributes Names?
 - Where can I write a program and execute it?
 - How to get the file size using ftell() and fseek() functions?
 - How to get the current source file path?
 - What about predefined parameters or optional parameters in functions?
 - How to print keys or values only in List/Dictionary?
 - Why I get a strange result when printing nl with lists?
 - Could you explain the output of the StrCmp() function?
 - How to use many source code files in the project?
 - Why this example use the GetChar() twice?
 - How to use NULL and ISNULL() function?
 - How to print lists that contains objects?
 - How to insert an item to the first position in the list?
 - How to print new lines and other characters?
 - Why we don’t use () after the qApp class name?
 - Why the window title bar is going outside the screen?
 - How to create an array of buttons in GUI applications?
 - How to Close a window then displaying another one?
 - How to create a Modal Window?
 - How can I disable maximize button and resize window?
 - How to use SQLite using ODBC?
 - Can I connect to dbase/harbour database?
 - Why setClickEvent() doesn’t see the object methods directly?
 - Why I get Calling Function without definition Error?
 - Can Ring work on Windows XP?
 - How to extend RingQt and add more classes?
 - How to add Combobox and other elements to the cells of a QTableWidget?
 - How to perform some manipulations on selected cells in QTableWidget?
 
 - Language Reference
 - Resources