import: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 10: | Line 10: | ||
|s1= [[import]] variableName | |s1= [[import]] variableName | ||
|p1= variableName: [[String]] - variable to import | |p1= variableName: [[String]] or [[Array]] of [[String]]s - variable(s) to import | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <sqf> | |x1= <sqf> | ||
_myVar = 1; | private _myVar = 1; | ||
call | call | ||
{ | { | ||
import "_myVar"; // similar to: private _myVar = _myVar; | |||
} | }; | ||
</sqf> | </sqf> | ||
|x2= <sqf> | |x2= <sqf> | ||
_a = 1; | private _a = 1; | ||
_b = 2; | private _b = 2; | ||
call | call | ||
{ | { | ||
import ["_a", "_b"]; // similar to: [_a, _b] params ["_a", "_b"]; | |||
} | }; | ||
</sqf> | </sqf> | ||
|seealso= [[privateAll]] [[private]] [[params]] | |seealso= [[privateAll]] [[private]] [[params]] | ||
}} | }} |
Revision as of 17:35, 30 October 2023
Description
- Description:
- Imports one or multiple local variables from the parent scope, and defines them as private variables in the current scope. It can bypass privateAll.
- Groups:
- Variables
Syntax
- Syntax:
- import variableName
- Parameters:
- variableName: String or Array of Strings - variable(s) to import
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- privateAll private params
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