addTableEntry: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page addTableEntry to AddTableEntry without leaving a redirect: Converting page title to first-letter uppercase)
m (Text replacement - "<source" to "<syntaxhighlight")
 
(3 intermediate revisions by 2 users not shown)
Line 8: Line 8:
'''Note:''' adding a row to a table will not automatically change the table row value, so this should be updated to avoid possible errors (See {{func|setTableRoll}} function).
'''Note:''' adding a row to a table will not automatically change the table row value, so this should be updated to avoid possible errors (See {{func|setTableRoll}} function).
|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
addTableEntry(tableName,rangeStart,rangeEnd,result)
addTableEntry(tableName,rangeStart,rangeEnd,result)
addTableEntry(tableName,rangeStart,rangeEnd,result,imageId)
addTableEntry(tableName,rangeStart,rangeEnd,result,imageId)
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|tableName|A string containing the name of the Table.}}
{{param|tableName|A string containing the name of the Table.}}
Line 19: Line 19:
{{param|imageId|Optional and is the asset id of an image that will be returned by the '''tableImage()''' function.}}
{{param|imageId|Optional and is the asset id of an image that will be returned by the '''tableImage()''' function.}}
|examples=
|examples=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r:addTableEntry("test",1,3,"bert")]
[r:addTableEntry("test",1,3,"bert")]
[r:addTableEntry("test",4,4,"fred")]
[r:addTableEntry("test",4,4,"fred")]
[r:addTableEntry("test",5,5,"alf", getTokenImage())]
[r:addTableEntry("test",5,5,"alf", getTokenImage())]
[r:setTableRoll("test","")]
[r:setTableRoll("test","")]
</source>
</syntaxhighlight>
|also=
|also=
{{func|setTableRoll}} {{func|table}} {{func|tableImage}} {{func|deleteTableEntry}}
{{func|setTableRoll}} {{func|table}} {{func|tableImage}} {{func|deleteTableEntry}}
}}
}}
[[Category:Table Function]]
[[Category:Table Function]]

Latest revision as of 23:59, 14 March 2023

addTableEntry() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.4.0.1
Adds a new row to the specified table. Note: adding a row to a table will not automatically change the table row value, so this should be updated to avoid possible errors (See setTableRoll() function).

Usage

addTableEntry(tableName,rangeStart,rangeEnd,result)
addTableEntry(tableName,rangeStart,rangeEnd,result,imageId)

Parameters

  • tableName - A string containing the name of the Table.
  • rangeStart - An integer indicating the lowest value that will return this row.
  • rangeEnd - An integer indicating the highest value that will return this row.
  • result - A string containing the result returned by the table() function.
  • imageId - Optional and is the asset id of an image that will be returned by the tableImage() function.

Examples

[r:addTableEntry("test",1,3,"bert")]
[r:addTableEntry("test",4,4,"fred")]
[r:addTableEntry("test",5,5,"alf", getTokenImage())]
[r:setTableRoll("test","")]

See Also