mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-26 03:27:18 +00:00
Modify SetWidget to include use to set global variables. (#7608)
* Modify SetWidget to include use to set global variables. * Make sample variables easier to read. * Change text to indicate use of pragma whitespace trim. * Make compliant with 5.3.1 (?) release
This commit is contained in:
parent
1001590326
commit
ad9cb8a0a8
@ -1,6 +1,6 @@
|
|||||||
caption: set
|
caption: set
|
||||||
created: 20131115182700000
|
created: 20131115182700000
|
||||||
modified: 20220523075522407
|
modified: 20230720174707977
|
||||||
tags: Widgets
|
tags: Widgets
|
||||||
title: SetWidget
|
title: SetWidget
|
||||||
type: text/vnd.tiddlywiki
|
type: text/vnd.tiddlywiki
|
||||||
@ -120,3 +120,19 @@ src='<$set name="myTiddler" value="HelloThere">
|
|||||||
</$set>'/>
|
</$set>'/>
|
||||||
|
|
||||||
<<<
|
<<<
|
||||||
|
|
||||||
|
!! Using the Set Widget to Create Global Variables
|
||||||
|
|
||||||
|
There are times when it makes sense to use the features of the [[SetWidget]] rather than procedures or functions to create global variables. This can be accomplished by placing the set variable widget in a tiddler that is tagged [[$:/tags/Global|SystemTag: $:/tags/Global]]. If multiple variables are required, the set variable widget can be nested as shown here:
|
||||||
|
|
||||||
|
<<<
|
||||||
|
<div class="doc-example">
|
||||||
|
|
||||||
|
```
|
||||||
|
<$set name="myGlobalVariable" value="I am global">
|
||||||
|
<$set name="myOtherGlobalVariable" value="I am also a global variable.">
|
||||||
|
</$set>
|
||||||
|
</$set>
|
||||||
|
```
|
||||||
|
</div>
|
||||||
|
<<<
|
||||||
|
Loading…
Reference in New Issue
Block a user