How to make a global Carriage Return?

I know how to make a local variable carriage return. But a global variable has to be done with a macro or procedure, right? And there the CR is just white space.

Thanks!

Hi @Mark_S instead of a \define or \procedure pragma, you can use the <$set> widget to create variables within tiddlers tagged $:/tags/Global.

Thanks Jeremy,

I don’t see that this is documented (looking at the set widget and the global tag docs). It appears that you can only define one <$set> per tiddler. Is this correct, or is there some way to specify multiple variables?

Thank you!

Hi @Mark_S

Ouch, it would be good to fix that.

The <$set> widgets must be nested.

1 Like

I actually thought of nesting them. But when I do this:

<$set name="universal" value="stuff" >
<$set name="universal2" value="stuff2" >

</$set>
</$set>

Only the outer <<universal>> gives an output.

e.g.

Universal? <<universal>> <br/>
Universal2 ? <<universal2>>

yields

Universal? stuff
Universal2 ?

Thanks!

It’s not at all obvious, but to avoid extraneous <p> tags that block the import process, it is necessary to separate the set widgets with a blank line:

<$set name="universal" value="stuff">

<$set name="universal2" value="stuff2">

</$set>

</$set>

Yes, this is important to be documented. I always thought the scope of variable is defined in $set is like below

<$set ...>

scope of variable
</$set>

Now I see if this definition packed in atiddler tagged with $:/tags/Macro or $:/tags/Global it is accessible outside the <$set name=...>...</$set>

1 Like

Yes this was a supprise to me, buit it has being said “macros/variables were a form of Set”, so I suppose it makes sence, “set is a form of macro/variable”.

  • The question now arrises is vars and let also?
  • Can a global tiddler make use of the emptyValue parameter of set and other features?
  • Can it make use of the multi-step nature of the let?
1 Like

There is a PR in play. 7608

1 Like