Subject: Re: [tw] Re: [TW5] Desirable core additions



A Quick description, I hope it helps

Psudo-Constants
TiddlerA has a title or field name
To set a constant you need to define a "variable" using the value of the tiddler title or field, however when you use any reference to the title or field it will be a string that refers to the field not the current value of the field. As a result it gets wikified in context and may refer to another tiddlers title or field depending on where it is used.
I have used two variable names and wikify to partially solve this. Quite cumbersome and it took time to find this solution. The ability to use the constant still seems limited.
\define currentobjectsrc() {{!!title}}\end<$wikify name="currentobject" text=<<currentobjectsrc>>>
I can now use the value in subtiddlers using <<currentobject>> but only where this is valid. It retains its value (in this case "the text "TiddlerA" in all subtiddlers, Can I use nested {{{}}} or something to make this work in macros and filters ? I am still trying to learn the different ways in the different widgets macros, template tiddler etc... Actually I know the answer to this it is documented at tiddlywiki.com however it is very contextual.

Perhaps there is a specific use of $set that is available to me, but I have not found it yet. It would be great if I could use a simple command like<$set Constant=constantname value=((!!title}}>
Such the constantname now contains "TiddlerA" and can be accessed by various and consistent means in all subTiddlers (those called/Transcluded) by TiddlerA
To be clear I want to use {{!!title}} not {{TiddlerA!!title}} because I do not want to hard code "TiddlerA" into the TiddlerA tiddler because when cloned or copied it will have a new name or a different value in a field.
I have found many of the documented syntax or examples refer to "somename" rather than a name derived from a field, that does not change with tiddler or context.
r>I will try and publish into on my project soon, and perhaps there are other ways do achieve what I am doing. 
I am now in the process of memorising a "dozen" "substitution rules" to understand this.
Thanks For the help.
TonyM





On Friday, August 11, 2017 at 5:11:35 AM UTC+10, Danielo Rodríguez wrote:I'm still not understand why the set widget does not work for you. It sets a variable with certain name and that variable is accessible to all it's children . How is your requirement different ?

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f1eb3f6f-a539-42f0-9e10-6188004daa25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Programming list archiving by: Enterprise Git Hosting