Oxygen 2 Misc Documentation: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[[Cc]ategory:ArmA:[ _]?([^|]+)\]\]" to "{{GameCategory|arma1|$1}}") |
Lou Montana (talk | contribs) m (Text replacement - " (={2,})([^ = ])(.*)([^ = ])(={2,}) * " to " $1 $2$3$4 $5 ") |
||
Line 5: | Line 5: | ||
*[[Strings]] | *[[Strings]] | ||
==if then else== | == if then else == | ||
if (something == 1) then {fred=1;}else{fred=2;}; | if (something == 1) then {fred=1;}else{fred=2;}; | ||
==functions== | == functions == | ||
_SomeFunc= | _SomeFunc= | ||
Line 23: | Line 23: | ||
if (_in== 1) then {1}else{2}; // achieves same | if (_in== 1) then {1}else{2}; // achieves same | ||
}; | }; | ||
==comment== | == comment == | ||
comment "comment" | comment "comment" | ||
Line 32: | Line 32: | ||
// comments | // comments | ||
==messageBox [text,nButtons]== | == messageBox [text,nButtons] == | ||
Returns ID of pressed button | Returns ID of pressed button | ||
Line 43: | Line 43: | ||
==isnil== | == isnil == | ||
example: | example: | ||
Line 55: | Line 55: | ||
==nil== | == nil == | ||
example: | example: |
Revision as of 18:52, 31 January 2021
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;};
note that exitwith is pretty close to useless it ONLY breaks out of the current braces, not, out of a subroutine per se
nil
example:
_dirs= shellCmdOpenPipe(".... { process... } _dirs=nil;