Oxygen 2 Misc Documentation

From Bohemia Interactive Community
Revision as of 06:17, 15 March 2010 by Mikero (talk | contribs)
Jump to navigation Jump to search

if then else

if (something == 1) then {fred=1;}else{fred=2;};

functions

_SomeFunc=
{
  
  private ["_in","_out"];
  _in=_this@0;
  if (_in== 1) then {_out=1;}else{_out=2;};
  out   // lack of semi colon returns content of out

equally

  if (_in== 1) then {_out=1}else{_out=2}; // achieves same
};

comment

comment "comment" /* comments

  • /

// comments

messageBox [text,nButtons]

Returns ID of pressed button

Shows message box with text and buttons.

nButtons is undocumented but probably follows the msoft conventions of ok, cancel, blah, + warning icons

nButtons 0: == OK only


isnil

example:

 if (isnil("_exists")) ExitWith(_file_exists=false;};
 if (!isnil("_exists")) ExitWith(_file_exists=true;};

nil

example:

 _dirs= shellCmdOpenPipe("....
{
  process...
}
_dirs=nil;