mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-05-02 19:51:30 +00:00
Docs updates
This commit is contained in:
@@ -3,9 +3,41 @@ created: 20250307212252946
|
||||
modified: 20250307212252946
|
||||
tags: Concepts Variables
|
||||
|
||||
<<.from-version "5.3.7">> In ordinary usage, [[variables|Variables]] contain a single spinnet of text. With the introduction of multi-valued variables. it is now possible to store a list of multiple values in a single variable. When accessed in the usual way, only the first value is returned, but using round brackets instead of angle brackets around the variable name allows access to the complete list of the values. This makes the existence of multi-valued variables largely invisible unless you specifically need to use them.
|
||||
<<.from-version "5.3.7">> In ordinary usage, [[variables|Variables]] contain a single snippet of text. With the introduction of multi-valued variables. it is now possible to store a list of multiple values in a single variable. When accessed in the usual way, only the first value is returned, but using round brackets instead of angle brackets around the variable name allows access to the complete list of the values. This makes multi-valued variables largely invisible unless you specifically need to use them.
|
||||
|
||||
The <<.wid let>> widget also allows [[multi-valued variables|Multi-Valued Variables]] to be set in one operation, each to the complete list of results obtained from evaluating an attribute.
|
||||
# Setting Multi-Valued Variables
|
||||
|
||||
## LetWidget
|
||||
|
||||
The <<.wid let>> widget allows multi-valued variables to be set in one operation, each to the complete list of results obtained from evaluating an attribute that is defined via a filtered transclusion. For example:
|
||||
|
||||
```
|
||||
<$let
|
||||
varname={{{ [all[tiddlers]sort[]] }}}
|
||||
>
|
||||
```
|
||||
|
||||
The <<.wid let> widget also allows the complete list of return values from a function to be assigned to a multi-valued variable. For example:
|
||||
|
||||
```
|
||||
<$let
|
||||
varname=<<my.func>>
|
||||
>
|
||||
```
|
||||
|
||||
## [[Let Filter Run Prefix]]
|
||||
|
||||
The `:let` filter run prefix (or its shortcut syntax `=>`) assigns the complete list of results of a filter run to a multi-valued variable.
|
||||
|
||||
# Retrieving Multi-Valued Variables
|
||||
|
||||
## [[title Operator]]
|
||||
|
||||
## Multi-valued Parameters for Filter Operators
|
||||
|
||||
|
||||
|
||||
# Examples
|
||||
|
||||
For example:
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ type: text/vnd.tiddlywiki
|
||||
* A <<.def variable>> is a ''snippet of text'' that can be accessed by name
|
||||
* The text is referred to as the variable's <<.def value>>
|
||||
|
||||
<<.from-version "5.3.7">> In ordinary usage, variables contain a single spinnet of text. With the introduction of [[Multi-Valued Variables]] it is now possible to store a list of multiple values in a single variable. When accessed in the usual way, only the first value is returned, but using round brackets instead of the usual angle brackets retrieves the complete list of values. This makes the existence of multi-valued variables largely invisible unless you specifically need to use them.
|
||||
<<.from-version "5.3.7">> In ordinary usage, variables contain a single snippet of text. With the introduction of [[Multi-Valued Variables]] it is now possible to store a list of multiple values in a single variable. When accessed in the usual way, only the first value is returned, but using round brackets instead of the usual angle brackets retrieves the complete list of values. This makes the existence of multi-valued variables invisible unless you specifically need to use them.
|
||||
|
||||
Variables are defined by [[widgets|Widgets]]. Several core widgets define variables, the most common being the <<.wlink LetWidget>>, <<.wlink SetWidget>> and <<.wlink ListWidget>> widgets.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user