User:Verisimilar/Sandbox: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) (New page: =How To Use This Template= When creating a new page that displays information about a macro function, this template should be used for uniformity. What follows are instructions on how to ...) |
Verisimilar (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
<source lang="mtmacro" line> | |||
@onCampaignLoad | |||
[defineFunction("get", "get@this")] | |||
<source lang=" | @get | ||
[h: checkProp = json.contains(getPropertyNames('json'), arg(0))] | |||
[h,assert(checkProp, '<b>ERROR:</b> get("'+arg(0)+'") - That property does not exist.', 0)] | |||
[h, macro.return = getProperty(arg(0))] | |||
'' | |||
' | |||
< | |||
</ | |||
' | |||
@onCampaignLoad | |||
[defineFunction("set", "set@this")] | |||
= | @set | ||
< | [h: checkProp = json.contains(getPropertyNames('json'), arg(0))] | ||
[h,assert(checkProp, '<b>ERROR:</b> set('+arg(0)+', '+arg(1)+') - That property does not exist.', 0)] | |||
[h: setProperty(arg(0), arg(1))] | |||
[h, macro.return = 1] | |||
</source> | </source> | ||
Revision as of 23:51, 24 March 2009
@onCampaignLoad
[defineFunction("get", "get@this")]
@get
[h: checkProp = json.contains(getPropertyNames('json'), arg(0))]
[h,assert(checkProp, '<b>ERROR:</b> get("'+arg(0)+'") - That property does not exist.', 0)]
[h, macro.return = getProperty(arg(0))]
@onCampaignLoad
[defineFunction("set", "set@this")]
@set
[h: checkProp = json.contains(getPropertyNames('json'), arg(0))]
[h,assert(checkProp, '<b>ERROR:</b> set('+arg(0)+', '+arg(1)+') - That property does not exist.', 0)]
[h: setProperty(arg(0), arg(1))]
[h, macro.return = 1]