Cicode functions have up to seven parts: Scope, Type, Keyword, Name, Argument(s), Statement(s), Keyword.
The scope of the function. If the scope is omitted, the function will be Public by default. That is, it will be available to all Cicode files, pages, and CitectSCADA databases (for example, Alarm.dbf). To make a function Private (that is only available within the file in which it is declared), you need to prefix it with the word PRIVATE.
The return type of the function. This should be on a separate line.
The keyword FUNCTION. This should be on a separate line.
The function name. Function names should follow the Function Naming Standards. This should be on a separate line.
The argument list. The arguments are separated by commas and they can have default values. The argument list is normally on the same line as the function name but multiple line argument list is also acceptable if it improves readability.
The statements. Each statement should be on a separate line.
The keyword END which marks the end of the function. This should be on a separate line.
Note: Parts contained within square brackets - [ ] - are optional. For example, the scope may be omitted and if so, it will default to Public. Parts contained within greater than & less than signs - < > - should be replaced with the relevant text/value. For example, you would replace <initial value> with an actual value. You would not bracket your value with greater than & less than signs.
PlotOpen(STRING sName, INT nMode)
INT hPlot = _BAD_HANDLE;
hPlot = .....;
WasteInfoName(INT nType, INT nMode)
STRING sName = "Sydney";
sName = .....;
Using Cicode Functions
Using Cicode Programming Standards