Functions
Functions in CES are used to group instructions into reusable blocks of code.
They help organize scripts, reduce repetition, and make code easier to maintain.
A function can contain variables, conditions, loops, and other function calls.
Declaring a function
To declare a function, use the func keyword followed by the function name and a block of code.
Example:
Calling a function
To execute a function, simply write its name followed by parentheses.
Example:
Expected output

Function with parameters
Functions can also receive values as parameters.
Example:
Expected output

Function with return
Functions can return values using the return keyword.
To define the return type, place : Type after the parameter list.
Calling the function:
Output:
Note
If a function declares a return type, it should return a compatible value.
Complete Example
func GetMessage(Str name): Str {
return "Hello " + name;
}
String msg : GetMessage("Ana");
DisplayLog(msg);
Output:
In this example:
GetMessagereceives one parameter (name)- the function returns a
String - the returned value is stored in
msg DisplayLogprints the result ```