herolab.hasChanged: Difference between revisions
Jump to navigation
Jump to search
m (Conversion script moved page herolab.hasChanged to Herolab.hasChanged without leaving a redirect: Converting page title to first-letter uppercase) |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
herolab.hasChanged() | herolab.hasChanged() | ||
herolab.hasChanged( | herolab.hasChanged(tokenRef) | ||
</ | </syntaxhighlight> | ||
See {{func|herolab.refresh}} to update the token's portfolio information. | See {{func|herolab.refresh}} to update the token's portfolio information. | ||
'''Parameters''' | '''Parameters''' | ||
{{param|id| | {{param|tokenRef|Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token. Defaults to the Current Token.}} | ||
{{Note|Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.}} | |||
|example= | |example= | ||
Determine if the associated Hero Lab portfolio has changed. | Determine if the associated Hero Lab portfolio has changed. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: isDirty = herolab.hasChanged()] | [r: isDirty = herolab.hasChanged()] | ||
</ | </syntaxhighlight> | ||
Returns: | Returns: | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
0 or 1 | 0 or 1 | ||
</ | </syntaxhighlight> | ||
|also= | |also= |
Latest revision as of 23:59, 17 May 2024
herolab.hasChanged() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.5
Returns a boolean value of true if the portfolio file has been modified compared to the current stored data on the token, otherwise returns false.
Usage
herolab.hasChanged()
herolab.hasChanged(tokenRef)
See herolab.refresh() to update the token's portfolio information.
Parameters
tokenRef
- Either the tokenid
or Token Name of the token. Defaults to the Current Token.
Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.
Example
Determine if the associated Hero Lab portfolio has changed.
[r: isDirty = herolab.hasChanged()]
Returns:
0 or 1
See Also
Version Changes
- 1.5 - Added to main MapTool build.