compile: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Some wiki formatting)
 
(82 intermediate revisions by 19 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|COMPILE]]
{{RV|type=command
[[Category:Scripting Commands ArmA|COMPILE]]


|game1= arma1
|version1= 1.00


<h2 style="color:#000066">''' compile ''expression'''''</h2>
|game2= arma2
|version2= 1.00


|game3= arma2oa
|version3= 1.50


'''Operand types:'''
|game4= tkoh
|version4= 1.00


'''expression:''' [[String]]
|game5= arma3
|version5= 0.50


'''Type of returned value:'''
|gr1= Strings


[[Code]]
|descr= Compiles [[String]] expression into [[Code]].


'''Compatibility:'''
|s1= [[compile]] expression


Version 2.60 required.
|p1= expression: [[String]] - expression to be compiled


'''Description:'''
|r1= [[Code]] - compiled expression


Compile expression.
|x1= <sqf>
_string = "a = a + 1";
_code = compile _string;
call _code;
</sqf>


'''Example''':
|x2= <sqf>
hint str compile "a = b";
// result: { a = b }
</sqf>


_function = "a = a + 1"; _compiled = '''compile''' _function; [[call]] _compiled;
|seealso= [[call]] [[spawn]] [[compileFinal]] [[compileScript]] [[parseSimpleArray]] [[isFinal]]
}}

Latest revision as of 13:05, 13 May 2022

Hover & click on the images for description

Description

Description:
Compiles String expression into Code.
Groups:
Strings

Syntax

Syntax:
compile expression
Parameters:
expression: String - expression to be compiled
Return Value:
Code - compiled expression

Examples

Example 1:
_string = "a = a + 1"; _code = compile _string; call _code;
Example 2:
hint str compile "a = b"; // result: { a = b }

Additional Information

See also:
call spawn compileFinal compileScript parseSimpleArray isFinal

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