Pre3.9 - Functions, redo, and string manipulations !
Pre-release
Pre-release
Pre3.9
- IDE
- Added a memory system to the IDE
- Every time you close the IDE, it will save the last cursor position, and it will set the cursor to the correct position once you open this file again.
- Redo
- New console command
- Re-iterates the last action you did
- String manipulations
- 2 new
var_actions
:replace
andsplit
replace
- Replaces elements of the string.
- Syntax :
--replace:"<element_to_replace>""<replace_with>"["count"]
- The first
count
element_to_replace
will be searched through the string and replaced by thereplace_with
. - If
count
is undefined, all theelement_to_replace
will be replaced byreplace_with
. - Example 1 (Without
count
) :var:str--replace:"e""a" Test = Yeeeeeeeeeeeeeeeee
will result inYaaaaaaaaaaaaaaaaa
- Example 2 (With
count
) :var:str--replace:"e""a""3" Test = Yeeeeeeeeeeeeeeeee
will result inYaaaeeeeeeeeeeeeee
split
- Splits the string into a string
- Syntax :
--split:"<separator>"
- Example 1 :
var:str--split:" " Test = This is a test string.
will result in['This', 'is', 'a', 'test', 'string.']
- Example 2 :
var:str--split:"ng " Test = Testing string :D
will result in['Testi', 'stri', ':D']
- FUNCTIONS
- Biggest feature of the update
- Functions allow to write some code once and reuse it as much as you want.
- How to define a function (without parameters) ?
- Type
function <name>
- Write the code of the function under it
- End by
endfunction
orend function
- Type
- How can I call a function (without parameters) ?
- Type
use_function <function_name>
- Type
- How to define a function (with parameters) ?
- Add the parameter names (separated by spaces) after the
function <name>
- You can then use them inside the function as normal variables. But if you modify them, they'll become global variables.
- Example :
function hello first_name last_name
- Add the parameter names (separated by spaces) after the
- How can I call a function (with parameters) ?
- Add the values of the parameters after the
use_function <function_name>
, separated by spaces. - They can be hardcoded values, variables, or equations.
- Example, following the function defined above :
use_function hello TheAssassin71 {last_name}
- Add the values of the parameters after the