import: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Add import (Config) link)
m (Add devbranch)
Line 3: Line 3:
|game1= arma3
|game1= arma3
|version1= 2.16
|version1= 2.16
|branch= dev


|gr1= Variables
|gr1= Variables

Revision as of 12:15, 23 November 2023

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.16.

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.
For the config keyword, see import (Config).
Groups:
Variables

Syntax

Syntax:
import variableName
Parameters:
variableName: String or Array of Strings - variable(s) to import
Return Value:
Nothing

Examples

Example 1:
private _myVar = 1; call { import "_myVar"; // similar to: private _myVar = _myVar; };
Example 2:
private _a = 1; private _b = 2; call { import ["_a", "_b"]; // similar to: [_a, _b] params ["_a", "_b"]; };

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