DocumentVariableList: Difference between revisions
No edit summary |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
[[Category:SDK]] | [[Category:SDK]] | ||
This object is responsible for managing all the document variables associated with a Job. A reference to a DocumentVariableList is obtained via the DocumentVariables property of the VectricJob. | This object is responsible for managing all the document variables associated with a Job. A reference to a DocumentVariableList is obtained via the DocumentVariables property of the VectricJob. | ||
==Methods== | ==Methods== | ||
'''Example Code''' | |||
<nowiki> | |||
-- VECTRIC LUA SCRIPT | |||
function main() | |||
MessageBox("Hello") | |||
local job = VectricJob() | |||
local document_variable_list = job.DocumentVariables | |||
document_variable_list:SetDocumentVariable("Test", 1.25) | |||
return true | |||
end | |||
</nowiki> | |||
===:DocumentVariableExists( string variable_name)=== | ===:DocumentVariableExists( string variable_name)=== | ||
'''Returns:''' (bool) true if a DocumentVariable with the passed name exists | '''Returns:''' (bool) true if a DocumentVariable with the passed name exists | ||
Variable_name (string) Name for variable | |||
===:GetDocumentVariable( string variable_name)=== | ===:GetDocumentVariable( string variable_name)=== | ||
'''Returns:''' (string) a DocumentVariable with the passed name if exists otherwise nil | '''Returns:''' (string) a DocumentVariable with the passed name if exists otherwise nil | ||
Variable_name (string) Name for variable | |||
Line 22: | Line 34: | ||
===:SetDocumentVariable( string variable_name, double value)=== | ===:SetDocumentVariable( string variable_name, double value)=== | ||
Sets the DocumentVariable with the specified name to the passed value. It either creates a new variable if one with the passed name doesn’t exist or updates the current one to the new value. Please see the documentation for IsInvalidDocumentVariableName as to what constitutes a valid variable name. | Sets the DocumentVariable with the specified name to the passed value. It either creates a new variable if one with the passed name doesn’t exist or updates the current one to the new value. Please see the documentation for IsInvalidDocumentVariableName as to what constitutes a valid variable name. | ||
Variable_name (string) Name for variable | |||
Value (double) value of the variable | |||
===:DocumentVariable True(string variable_name)=== | ===:DocumentVariable True(string variable_name)=== | ||
'''Returns:''' (bool) true if a DocumentVariable with the passed name is deleted otherwise false. Please note DocumentVariables considered to be in use cannot be deleted. | '''Returns:''' (bool) true if a DocumentVariable with the passed name is deleted otherwise false. Please note DocumentVariables considered to be in use cannot be deleted. | ||
Variable_name (string) Name for variable | |||
===:GetHeadPosition()=== | ===:GetHeadPosition()=== | ||
'''Returns:''' a (POSITION) variable to allow access to the head of the list of DocumentVariables in the list | '''Returns:''' a (POSITION) variable to allow access to the head of the list of DocumentVariables in the list | ||
===:GetNext( POSITION pos)=== | ===:GetNext( POSITION pos)=== | ||
'''Returns:''' (POSITION) the DocumentVariable at the current position AND a new value for position pointing to the next item in the list (or nil if at end of list) | '''Returns:''' (POSITION) the DocumentVariable at the current position AND a new value for position pointing to the next item in the list (or nil if at end of list) | ||
pos (POSITION) current position in group | |||
[[File:Back.jpg|right|50px|link=Vectric Lua Interface for Gadgets]] | [[File:Back.jpg|right|50px|link=Vectric Lua Interface for Gadgets]] | ||
==References== | ==References== | ||
'''Please Note:''' The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 10.0, published August 21, 2019. by Vectric Ltd. Most current document from Vertric can be downloaded at [https://gadgets.vectric.com/developerinfo.html Vertric Developer Information] | '''Please Note:''' The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 10.0, published August 21, 2019. by Vectric Ltd. Most current document from Vertric can be downloaded at [https://gadgets.vectric.com/developerinfo.html Vertric Developer Information] |
Latest revision as of 08:49, 15 May 2024
This object is responsible for managing all the document variables associated with a Job. A reference to a DocumentVariableList is obtained via the DocumentVariables property of the VectricJob.
Methods
Example Code -- VECTRIC LUA SCRIPT function main() MessageBox("Hello") local job = VectricJob() local document_variable_list = job.DocumentVariables document_variable_list:SetDocumentVariable("Test", 1.25) return true end
:DocumentVariableExists( string variable_name)
Returns: (bool) true if a DocumentVariable with the passed name exists Variable_name (string) Name for variable
:GetDocumentVariable( string variable_name)
Returns: (string) a DocumentVariable with the passed name if exists otherwise nil Variable_name (string) Name for variable
:SetDocumentVariable( string variable_name, double value)
Sets the DocumentVariable with the specified name to the passed value. It either creates a new variable if one with the passed name doesn’t exist or updates the current one to the new value. Please see the documentation for IsInvalidDocumentVariableName as to what constitutes a valid variable name.
Variable_name (string) Name for variable Value (double) value of the variable
:DocumentVariable True(string variable_name)
Returns: (bool) true if a DocumentVariable with the passed name is deleted otherwise false. Please note DocumentVariables considered to be in use cannot be deleted. Variable_name (string) Name for variable
:GetHeadPosition()
Returns: a (POSITION) variable to allow access to the head of the list of DocumentVariables in the list
:GetNext( POSITION pos)
Returns: (POSITION) the DocumentVariable at the current position AND a new value for position pointing to the next item in the list (or nil if at end of list) pos (POSITION) current position in group
References
Please Note: The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 10.0, published August 21, 2019. by Vectric Ltd. Most current document from Vertric can be downloaded at Vertric Developer Information