Oxygen 2 Misc Documentation: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 21: Line 21:
  equally
  equally
   
   
   if (_in== 1) then {_out=1}else{_out=2}; // achieves same
   if (_in== 1) then {1}else{2}; // achieves same
  };
  };
==comment==
==comment==

Revision as of 05:17, 15 March 2010

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 {1}else{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;