isFinal: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[cC]ommand[_ ][gG]roup:[_ ][^|]+\|\{*uc:{{PAGENAME}*]\]" to "")
m (Some wiki formatting)
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Command
{{RV|type=command
 
|game1= a3


|game1= arma3
|version1= 2.00
|version1= 2.00


|gr1= Variables |GROUP1=
|gr1= Variables


|descr= Checks if [[Code|code]] or a variable was compiled final with [[compileFinal]].
|descr= Checks if [[Code|code]] or a variable was compiled final with [[compileFinal]].
Line 21: Line 20:
|r2= [[Boolean]] - [[true]] if final, [[false]] if not
|r2= [[Boolean]] - [[true]] if final, [[false]] if not


|x1= <code>myCode = [[compileFinal]] "a = a + 1";
|x1= <sqf>
[[if]] ([[isFinal]] myCode) [[then]] {[[systemChat]] "Code is compiled final."};</code>|example1=
myCode = compileFinal "a = a + 1";
 
if (isFinal "myCode") then { systemChat "Code is compiled final." };
|x2= <code>[[if]] ([[isFinal]] [[BIS_fnc_arsenal]]) then {[[hint]] "You can't edit this function!"};</code>|example2=
</sqf>


|x3= Avoid overwrite .rpt warnings<code>[[if]] (![[isFinal]] fnc_myCode) [[then]] { fnc_myCode = [[compileFinal]] str_myCode };</code>|example3=
|x2= <sqf>if (isFinal BIS_fnc_arsenal) then {chint "You can't edit this function!" };</sqf>


|x3= Avoid overwrite .rpt warnings:
<sqf>if (!isFinal fnc_myCode) then { fnc_myCode = compileFinal str_myCode };</sqf>


|seealso= [[compile]] [[compileFinal]]
|seealso= [[compile]] [[compileFinal]]
}}
}}

Revision as of 13:00, 4 May 2022

Hover & click on the images for description

Description

Description:
Checks if code or a variable was compiled final with compileFinal.
Groups:
Variables

Syntax

Syntax:
isFinal variable
Parameters:
varName: String - A String pointing to a variable
Return Value:
Boolean - true if final, false if not

Alternative Syntax

Syntax:
isFinal code
Parameters:
code: Code - Some code
Return Value:
Boolean - true if final, false if not

Examples

Example 1:
myCode = compileFinal "a = a + 1"; if (isFinal "myCode") then { systemChat "Code is compiled final." };
Example 2:
if (isFinal BIS_fnc_arsenal) then {chint "You can't edit this function!" };
Example 3:
Avoid overwrite .rpt warnings:
if (!isFinal fnc_myCode) then { fnc_myCode = compileFinal str_myCode };

Additional Information

See also:
compile compileFinal

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