isFinal: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "1.99" to "2.00") |
Lou Montana (talk | contribs) m (Text replacement - "|game1= a3 " to "|game1= arma3 ") |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
|game1= | |game1= arma3 | ||
|version1= 2.00 | |version1= 2.00 | ||
|gr1= Variables | |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 12: | Line 12: | ||
|p1= varName: [[String]] - A [[String]] pointing to a variable | |p1= varName: [[String]] - A [[String]] pointing to a variable | ||
|r1= [[Boolean]] - [[ | |r1= [[Boolean]] - [[true]] if final, [[false]] if not | ||
|s2= [[isFinal]] code | |s2= [[isFinal]] code | ||
Line 18: | Line 18: | ||
|p21= code: [[Code]] - Some code | |p21= code: [[Code]] - Some code | ||
|r2= [[Boolean]] - [[ | |r2= [[Boolean]] - [[true]] if final, [[false]] if not | ||
|x1= <code>myCode = [[compileFinal]] "a = a + 1"; | |x1= <code>myCode = [[compileFinal]] "a = a + 1"; | ||
[[if]] ([[isFinal]] myCode) [[then]] {[[systemChat]] "Code is compiled final."};</code> | [[if]] ([[isFinal]] myCode) [[then]] {[[systemChat]] "Code is compiled final."};</code> | ||
|x2= <code>[[if]] ([[isFinal]] [[BIS_fnc_arsenal]]) then {[[hint]] "You can't edit this function!"};</code> | |x2= <code>[[if]] ([[isFinal]] [[BIS_fnc_arsenal]]) then {[[hint]] "You can't edit this function!"};</code> | ||
|x3= Avoid overwrite .rpt warnings<code>[[if]] (![[isFinal]] fnc_myCode) [[then]] { fnc_myCode = [[compileFinal]] str_myCode };</code> | |||
|seealso= [[compile]] [[compileFinal]] | |seealso= [[compile]] [[compileFinal]] | ||
}} | }} | ||
Revision as of 18:34, 23 May 2021
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 {hint "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