switchToken: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Fixing wikilink) |
||
Line 4: | Line 4: | ||
|version=1.3b48 | |version=1.3b48 | ||
|description= | |description= | ||
Changes the [[Current Token]] for the remainder of the | Changes the [[Current Token]] for the remainder of the Macro. | ||
<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> |
Revision as of 10:37, 24 July 2011
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.
Usage
switchToken(tokenId)