From ad9cb8a0a8c740aeef3e795dca74e7dc979de528 Mon Sep 17 00:00:00 2001 From: Marxsal Date: Tue, 21 Nov 2023 03:55:54 -0800 Subject: [PATCH] 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 --- .../tw5.com/tiddlers/widgets/SetWidget.tid | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/widgets/SetWidget.tid b/editions/tw5.com/tiddlers/widgets/SetWidget.tid index fe05e8faa..f5b0786f3 100644 --- a/editions/tw5.com/tiddlers/widgets/SetWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/SetWidget.tid @@ -1,6 +1,6 @@ caption: set created: 20131115182700000 -modified: 20220523075522407 +modified: 20230720174707977 tags: Widgets title: SetWidget type: text/vnd.tiddlywiki @@ -120,3 +120,19 @@ src='<$set name="myTiddler" value="HelloThere"> '/> <<< + +!! 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: + +<<< +
+ +``` +<$set name="myGlobalVariable" value="I am global"> + <$set name="myOtherGlobalVariable" value="I am also a global variable."> + + +``` +
+<<<