2 single: What is new in Ring 1.12?; Introduction
4 =========================
5 What is new in Ring 1.12?
6 =========================
8 In this chapter we will learn about the changes and new features in Ring 1.12 release.
11 pair: What is new in Ring 1.12?; List of changes and new features
13 List of changes and new features
14 ================================
16 Ring 1.12 comes with the next features!
19 * ASCII Table application
20 * BMI Calculator application
21 * Calendar application
22 * Julian Day Calendar application
23 * Tutorial: Number to Words
25 * ring_state_filetokens() function
26 * Embedded Ring Object File
31 pair: What is new in Ring 1.12?; Go Game
36 An implementation for the Go Game
42 pair: What is new in Ring 1.12?; ASCII Table application
44 ASCII Table application
45 =======================
47 Simple application for displaying the ASCII table
49 .. image:: asciitable.png
53 pair: What is new in Ring 1.12?; BMI Calculator application
55 BMI Calculator application
56 ==========================
58 Simple application for calculating the BMI
64 pair: What is new in Ring 1.12?; Calendar application
69 The Calendar for Year 2020
71 .. image:: calendar.png
75 pair: What is new in Ring 1.12?; Julian Day Calendar application
77 Julian Day Calendar application
78 ===============================
80 The Julian Day Calendar application
82 .. image:: juliancalendar.png
83 :alt: juliandaycalendar
87 pair: What is new in Ring 1.12?; Tutorial: Number to Words
89 Tutorial: Number to Words
90 =========================
92 Folder : ring/samples/other/number2words
94 .. image:: number2words.png
98 pair: What is new in Ring 1.12?; Load Again Command
103 Ring 1.12 comes with the Load Again command
105 Using this command we can load the Ring source file which contains constants more than one time.
107 This is useful when using Ring source files for translations through global constants.
111 The next function is part from a project which support Arabic and English languages
113 The files english.ring and arabic.ring contains constants for translation
115 One of these files is loaded in the start of the program
117 Loading the same file again using the (Load) command is not possible
119 Because the (Load) command load the same source file only for the first time and ignore next times.
121 So we have to use the (Load Again) command.
123 Where we can use these files again during the runtime as in the next code
127 func setLang nLanguage
128 if C_ENV_DEFAULT_LANG = nLanguage
131 C_ENV_DEFAULT_LANG = nLanguage
132 # Change the language
134 on C_TRANSLATION_ENGLISH
135 load again "translation/english.ring"
136 on C_TRANSLATION_ARABIC
137 load again "translation/arabic.ring"
141 pair: What is new in Ring 1.12?; ring_state_filetokens() function
143 ring_state_filetokens() function
144 ================================
146 Using the ring_state_filetokens() function we can get all the tokens in the ring source code file.
150 C_FILENAME = "test_tokens.ring"
170 aKEYWORDS = ["IF","TO","OR","AND","NOT","FOR","NEW","FUNC",
171 "FROM","NEXT","LOAD","ELSE","SEE","WHILE","OK","CLASS","RETURN","BUT",
172 "END","GIVE","BYE","EXIT","TRY","CATCH","DONE","SWITCH","ON","OTHER","OFF",
173 "IN","LOOP","PACKAGE","IMPORT","PRIVATE","STEP","DO","AGAIN","CALL","ELSEIF",
174 "PUT","GET","CASE","DEF","ENDFUNC","ENDCLASS","ENDPACKAGE",
175 "CHANGERINGKEYWORD","CHANGERINGOPERATOR","LOADSYNTAX"]
177 pState = ring_state_new()
178 aList = ring_state_filetokens(pState,C_FILENAME)
180 ring_state_delete(pState)
182 func PrintTokens aList
186 ? Width("Keyword",C_WIDTH) + ": " + aKeywords[0+aToken[2]]
188 ? Width("Operator",C_WIDTH) + ": " + aToken[2]
190 ? Width("Literal",C_WIDTH) + ": " + aToken[2]
192 ? Width("Number",C_WIDTH) + ": " + aToken[2]
194 ? Width("Identifier",C_WIDTH) + ": " + aToken[2]
202 func Width cText,nWidth
203 return cText+copy(" ",nWidth-len(cText))
211 Literal : Hello, World!
229 pair: What is new in Ring 1.12?; Generate Embedded Object File
231 Generate Embedded Ring Object File
232 ==================================
234 We can generate embedded object file (C source code) from the source code file (*.ring)
243 This command will generate at least three files
251 More files could be generated based on the project size
253 The generated files will pass the byte code to Ring VM to be executed
256 pair: What is new in Ring 1.12?; Better RingRayLib
261 More Samples are added to RingRayLib
263 * Sound Loading Playing
265 * Music Playing Streaming
277 .. image:: raylib_cubicmap.png
281 pair: What is new in Ring 1.12?; More Improvements
287 * ring/samples/other/Hex2UTF8.ring
288 * ring/samples/other/CalmoSoftPrimesTable.ring
289 * ring/samples/other/CalmoSoftTicTacToeGame.ring
290 * ring/samples/other/CalmoSoftSimpleGoGame.ring
291 * ring/samples/other/arabicmysql.ring
292 * ring/samples/other/CalmoSoftExtraCube.ring
293 * ring/samples/other/DynamicCode/anonfunc.ring
294 * ring/samples/other/DynamicCode/deletethisfile.ring
295 * ring/samples/other/DynamicCode/modifythisfile.ring
296 * ring/samples/other/changesyntax/ArabicDemo.ring
297 * ring/samples/other/changesyntax/EnglishDemo.ring
298 * ring/samples/other/changesyntax/ChangeKeywordsArabic.ring
299 * ring/samples/other/changesyntax/ChangeKeywordsEnglish.ring
300 * ring/samples/other/changesyntax/pascal.ring
301 * ring/samples/other/hijridate.ring
303 * Ring Notepad - Project Files - set minimum width based on desktop screen width
304 * Ring Notepad - Output Window - Move the Cursor to the end of text
305 * Ring Notepad - Output Window - Correct displaying for line breaks
306 * Form Designer - Better Style - Controls colors and size
307 * VideoMusicPlayer is updated to work as expected after RingQt update
308 * FlappyBird3000 - Fast response on Android
309 * Snake Game : Change the default window size (800x600)
310 * Maze Game : Change the default window size (800x600)
311 * Maze Game : Move the camera with the player
312 * Maze Game : Restarting the game will hide the (You Win) message
313 * Game Engine : display error message when we can't create the game window
314 * Ring Tests : Added File build.sh for building on Linux and macOS
315 * RingQt : Updated to Qt 5.12.6
316 * RingQt : Added QQMLEngine class
317 * RingQt : Added files for building RingQt without Bluetooth support
318 * RingQt : The size of the events code is changed from 100 characters to 200 characters
319 * RingQt : Correct links for Qt documentation in RingQt classes chapter
320 * RingQt for Android : Better code for executing the Ring Object File (*.ringo)
321 * Ring2EXE configuration files are updated for RingQt to correctly distribute RingQt apps
322 * Code Generator : Convert function names to lower case when generating the functions for structures
323 * OSCopyFolder() function is updated to copy the files in sub folders too
324 * fgetpos() function is updated to work as expected
325 * IsFunction() function is updated to be not case sensitive
326 * Space() function is updated to clear the output string with spaces
327 * Ring Compiler : Added file buildclang.bat for building on Windows using Clang compiler
328 * Ring VM - Internal hash function is updated
329 * Ring VM - Better Code for setting pVM->aSetProperty when creating new objects
330 * Ring VM - Better Code for state managment