Here you’re in the final chapter in the tutorial.
This is very easy chapter to understand.
We’ll learn first Try/Catch/Done:
try see x = 5 catch see 'error' + nl + cCatchError #we use this variable to get the error message Done
eval('x = 5') see x #output: 5 eval('x = 1*3') see x #output: 3 eval("func printme see 'print me please.'") printme()
We can use this to raise an exception.
raise('error: blah blah has just happened right now in the front of your eyes.')
Official example : here
We can use the Assert() function to test conditions before executing the code,
If the test fail the program will be terminated with an error message contains the assert condition.
x = 10 assert (x = 10) #will pass the test assert (x = 5) #won't pass the test, output: Line 3 Assertion Failed!
This is the end of this tutorial, of course it’s not the end of the official document, there’s more advanced stuff there, but i don’t want to continue through the rest of the document just like that, i need to parctice more on using the Ring first.
I will make new tutorials after a while.
Till that, i will be posting some ring codes, news, tools & add-ons and other stuff in the blog.
See you in the next post 🙂