Changes

Jump to navigation Jump to search
m
Elaborate example, terser definition, add category
<tr valign="top" class="second">
<td class="cmd">{...}</td>
<td>identifier name or number of table in data set</td>
</tr>
<tr valign="top" class="third">
<td class="cmd">{...}</td>
<td>key variable name</td>
</tr>
</table>
== Description ==
This command retrieves the values that have been saved with the <texcode>\datasetvariable{mydataset}{cmd|setdatasetmytable}{myvariable} </texcode>This command. The first argument is retrieves the value of <code>myvariable</code> in the data set name, given by table <code>mytable</code> stored in the first argument of {{cmd|setdataset}}. The second argument is an integer if {{cmd|setdataset}} was used with two arguments and an identifier if {{cmd|setdataset}} was used with three argumentsdataset <code>mydataset</code>. The last argument is the key, which value should be retrievedTwo complete examples are shown below.
== Usage ==
<texcode>
% Define a dataset called 'mysteries'\definedataset[mysteries] % The first anonymous table is stored at position 1, the second at position 2, etc.\setdataset[mysteries][assistant=Watson] % Retrieving an anonymous table\datasetvariable{somedatasetmysteries}{1}{fooassistant} % Watson
</texcode>
<texcode>
% Define a dataset called 'mysteries'\definedataset[mysteries] % Store a key-value dataset called 'Doyle'\setdataset[mysteries][Doyle][detective=Holmes, assistant=Watson, officer=Lestrade] % Retrive the variable 'assistant' from the 'Doyle' table in the 'mysteries' dataset\datasetvariable{somedatasetmysteries}{alphaDoyle}{barassistant} % Watson
</texcode>
 
== See also ==
<!-- something like {{cmd|goto}} -->
 
More detailled explanations and examples can be found under
[[System_Macros/Key_Value_Assignments|Key-Value Assignments]] section Two-pass data.
 
* {{cmd|definedataset}},to define a dataset for storing key-value tables* {{cmd|setdataset}}to store key-value tables in a dataset* More detailed explanations and examples can be found in the Key-Value Assignments article, under the section [[System_Macros/Key_Value_Assignments#Multi-pass data|Multi-pass data]].
{{Forum|{{SUBPAGENAME}}}}
[[Category:CommandsCommand/Datasets|datasetvariable]]

Navigation menu