import: Difference between revisions
Jump to navigation
Jump to search
m (2.16 -> 2.18) |
Hypoxic125 (talk | contribs) No edit summary |
||
Line 37: | Line 37: | ||
|seealso= [[privateAll]] [[private]] [[params]] | |seealso= [[privateAll]] [[private]] [[params]] | ||
}} | }} | ||
{{subst:Preload/Note|1= | |||
When making local functions, the imported variable does not have to exist until the function is called. | |||
<sqf> | |||
// Local function | |||
private _stringifyNum = { | |||
import "_num"; | |||
str _num; | |||
}; | |||
private _num = 5; | |||
call _stringifyNum; | |||
// Returns "5" | |||
</sqf> | |||
} |
Revision as of 19:30, 3 March 2024
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
{{subst:Preload/Note|1= When making local functions, the imported variable does not have to exist until the function is called.
}