switchToken: Difference between revisions
Jump to navigation
Jump to search
m (Fixing wikilink) |
No edit summary |
||
Line 7: | Line 7: | ||
<p>In practice, "the remainder of the Macro" is the same as the variable scope. Thus, if a macro is running as a user defined function (see {{func|defineFunction}} ) with a new scope, switchToken will only apply until the end of the current macro. Once control passes back to the calling macro, the [[Current Token]] reverts back to what it was before the external macro was called ( as a function ). | <p>In practice, "the remainder of the Macro" is the same as the variable scope. Thus, if a macro is running as a user defined function (see {{func|defineFunction}} ) with a new scope, switchToken will only apply until the end of the current macro. Once control passes back to the calling macro, the [[Current Token]] reverts back to what it was before the external macro was called ( as a function ). | ||
If a {{func|defineFunction}} does not create a new variable scope for the called macro, then effects of switchToken persist when control passes back to the calling macro.</p> | If a {{func|defineFunction}} does not create a new variable scope for the called macro, then effects of switchToken persist when control passes back to the calling macro.</p> | ||
'''Note: You cannot switch to a token on a different map.''' | |||
|usage= | |usage= |
Revision as of 15:57, 13 September 2020
switchToken() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.3b48
Changes the Current Token for the remainder of the Macro.
In practice, "the remainder of the Macro" is the same as the variable scope. Thus, if a macro is running as a user defined function (see defineFunction() ) with a new scope, switchToken will only apply until the end of the current macro. Once control passes back to the calling macro, the Current Token reverts back to what it was before the external macro was called ( as a function ). If a defineFunction() does not create a new variable scope for the called macro, then effects of switchToken persist when control passes back to the calling macro.
Note: You cannot switch to a token on a different map.Usage
switchToken(tokenId)