compile: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
 
m (Some wiki formatting)
 
(83 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


|gr1= Strings


'''Type of returned value:'''
|descr= Compiles [[String]] expression into [[Code]].


[[Code]]
|s1= [[compile]] expression


'''Compatibility:'''
|p1= expression: [[String]] - expression to be compiled


Version 2.60 required.
|r1= [[Code]] - compiled expression


'''Description:'''
|x1= <sqf>
_string = "a = a + 1";
_code = compile _string;
call _code;
</sqf>


Compile expression.
|x2= <sqf>
hint str compile "a = b";
// result: { a = b }
</sqf>


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

Latest revision as of 14: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