Goto http://www.stucuk.netGoto http://www.atlanticaonlinewiki.comGoto http://www.game-requirements.com

Functions

From Original War Support Wiki

Jump to: navigation, search

Tutorials -> Functions

Contents

Info

Your own functions act similar to variables. They are defined using 'function' command (or 'export function' to be able to use it in all modules):

function myfunction;
begin
//here comes the code
end;

You can define some variables in functions:

function myfunction;
var myvariable;
begin
//here comes the code
end;

They can also have parameters:

function myfunction(parameter1,parameter2);
var myvariable;
begin
//here comes the code
end;

Example function with parameters

export function KillAndWin(unit);
begin
KillUnit(unit);
YouWin;
end;

in any SAIL code:

KillAndWin(enemy);

Unit with 'enemy' identifier will be killed and you will win.

Some notes

1) Function's name cannot be the same as the name of any variable.

Personal tools
Clanbase
This is a cached copy of the requested page, and may not be up to date.

Sorry! This site is experiencing technical difficulties.
Try waiting a few minutes and reloading.

(Can't contact the database server: MySQL functions missing, have you compiled PHP with the --with-mysql option? )


You can try searching via Google in the meantime.
Note that their indexes of our content may be out of date.