with: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[[cC]ategory:[sS]cripting [cC]ommands\|[a-z A-Z 0-9_]+\]\]" to "")
m (Text replacement - "\{\{( *)Warning( *)\|" to "{{$1Feature$2|$Warning$2|")
Line 8: Line 8:


| Creates a [[With Type]] that is used inside a [[do]] construct in order to execute code inside a given namespace.  
| Creates a [[With Type]] that is used inside a [[do]] construct in order to execute code inside a given namespace.  
{{Warning | when used in a do-construct in scripts with allowed suspension, an unexpected namespace switch could happen (see note below)}}
{{Feature |$Warning | when used in a do-construct in scripts with allowed suspension, an unexpected namespace switch could happen (see note below)}}
'''NOTE''' for the reasons unknown, namespace switching might unexpectedly occur inside some scopes ([[for]], [[if]], [[try]], [[call]]) started in [[Scheduler#Scheduled_Environment|scheduled]] scripts ([[canSuspend]] true) after small suspension if [[with]] was not the main scope. For example:  
'''NOTE''' for the reasons unknown, namespace switching might unexpectedly occur inside some scopes ([[for]], [[if]], [[try]], [[call]]) started in [[Scheduler#Scheduled_Environment|scheduled]] scripts ([[canSuspend]] true) after small suspension if [[with]] was not the main scope. For example:  
<code>[] [[spawn]]
<code>[] [[spawn]]

Revision as of 01:19, 7 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Program Flow

Syntax

Syntax:
Syntax needed
Parameters:
namespace: Namespace
Return Value:
Return value needed

Examples

Example 1:
_myWithType = with uiNamespace;
Example 2:
with missionNamespace do {global = global + 1};

Additional Information

See also:
See also needed

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