call: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:Scripting Commands OFP 1.[4-9]{2}(\|(\{\{uc:\{\{PAGENAME\}\}\}\}|#))?\]\] " to "") |
m (formatting) |
||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| | |game1= ofp | ||
|version1= 1.85 | |||
|game2= ofpe | |||
|version2= 1.00 | |||
|game3= arma1 | |||
|version3= 1.00 | |||
|game4= arma2 | |||
|version4= 1.00 | |||
|game5= arma2oa | |||
|version5= 1.51 | |||
|game6= tkoh | |||
|version6= 1.00 | |||
|game7= arma3 | |||
|version7= 0.50 | |||
|gr1= Program Flow | |gr1= Program Flow | ||
| | |descr= Adds given set of compiled instructions to the current stack and waits for it to finish and return, provides an option to pass arguments to the executed [[Code]]. See [[Scheduler]] to learn more about how the code is excuted and behaves. | ||
| [[call]] code | |s1= [[call]] code | ||
|p1= code: [[Code]] - [[compile]] | |p1= code: [[Code]] - [[compile|Compiled]] instructions. In {{ofp}} this command also accepts datatype [[String|string]] | ||
| [[Anything]] - The last value given in the function is returned. See the topic [[Function#Return_Values|Function]] for more information. | |r1= [[Anything]] - The last value given in the function is returned. See the topic [[Function#Return_Values|Function]] for more information. | ||
|s2= args [[call]] code | |s2= args [[call]] code | ||
Line 21: | Line 43: | ||
|p21= args: [[Anything]] - Arguments that are passed to the function in the [[Magic Variables#this|_this]] variable | |p21= args: [[Anything]] - Arguments that are passed to the function in the [[Magic Variables#this|_this]] variable | ||
|p22= code: [[Code]] - [[compile| | |p22= code: [[Code]] - [[compile|Compiled]] instructions. In {{ofp}} this command also accepts datatype [[String|string]] | ||
|r2= [[Anything]] - The last value given in the function is returned. See the topic [[Function#Return_Values|Function]] for more information. | |r2= [[Anything]] - The last value given in the function is returned. See the topic [[Function#Return_Values|Function]] for more information. | ||
Line 36: | Line 58: | ||
|x5= <code>_result = 123 [[call]] [[compile]] [[preprocessFileLineNumbers]] "myFile.sqf";</code> | |x5= <code>_result = 123 [[call]] [[compile]] [[preprocessFileLineNumbers]] "myFile.sqf";</code> | ||
|seealso= [[spawn]] | |seealso= [[spawn]] [[execVM]] [[canSuspend]] [[compile]] [[compileScript]] [[preprocessFile]] [[remoteExec]] [[remoteExecCall]] | ||
}} | }} | ||
Revision as of 10:06, 27 March 2021
Description
- Description:
- Adds given set of compiled instructions to the current stack and waits for it to finish and return, provides an option to pass arguments to the executed Code. See Scheduler to learn more about how the code is excuted and behaves.
- Groups:
- Program Flow
Syntax
- Syntax:
- call code
- Parameters:
- code: Code - Compiled instructions. In Operation Flashpoint this command also accepts datatype string
- Return Value:
- Anything - The last value given in the function is returned. See the topic Function for more information.
Alternative Syntax
- Syntax:
- args call code
- Parameters:
- args: Anything - Arguments that are passed to the function in the _this variable
- code: Code - Compiled instructions. In Operation Flashpoint this command also accepts datatype string
- Return Value:
- Anything - The last value given in the function is returned. See the topic Function for more information.
Examples
- Example 1:
call { hint str 123; };
- Example 2:
123 call { hint str _this; };
- Example 3:
_sum = [1, 2] call { (_this select 0) + (_this select 1); }; hint str _sum; // displays 3
- Example 4:
123 call compile "hint str _this;";
- Example 5:
_result = 123 call compile preprocessFileLineNumbers "myFile.sqf";
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.85
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Program Flow