Creating Functions SubRoutines and Classes |
Top Previous Next |
One major difference between using Commando Script versus other code editors is the way that functions, subroutines and classes are created and edited. In Commando Script, you use a pop-up window to create your function, subroutine or class and only after you do that can you edit the code inside that sub/function. To create a new function, subroutine, class, public variable, or public constant double click the appropriate button in the project tree (see below). You can also double click any item in the tree to edit that item. See also: Editing Functions & Subs.
Creating a Function or SubRoutine
Use the mouse to double click the 'create' button in the subroutines section and the New SubRoutine window appears. Give it a name, define the scope (public or private) and list out any parameters you expect it to need and click 'Save', it's that easy.
The Debate Public Vs Private:
In Commando Script the only mandatory use of public vs private when declaring functions or subroutines is for the MESSAGEIN() Function and the PREPROCESS() Function. These two functions MUST be Public and MUST return a boolean value (True or False).
|