Cerberus X Documentation

Directive Strict

Enables Cerberus X's Strict syntax mode.

Syntax

Strict

Description

By default, Cerberus X allows you to take certain shortcuts when programming. However, Cerberus X also offers a special Strict mode for programmers who prefer a stricter language definition.

The differences between the Strict and non-Strict modes are:

Strict mode

Non-Strict mode

To use Strict mode, the Strict directive must be placed at the very top of your module. Note that Strict is applied on a per-module basis and that Strict and non-Strict modules can legitimately import each other.

While syntax is shown in Strict mode, the examples in this documentation will normally be presented in non-Strict form.

See also

Return | Int | Float | String | Bool | Void

Example

Strict

' In Strict mode...

Function Main:Int() ' the :Int type definition is compulsory...
Print( "Strict mode is...different!" ) ' all function calls require brackets...
Return 0 ' and we MUST return a value.
End

Example 2

' Non-Strict version of first example, declaring no Return
' type, no brackets for Print statement and no Return value.

Function Main ()
Print "Non-Strict mode is...forgiving!"
End