How concatenate in 5.3.0?

With the 5.3.0 features, I don’t understand how to concatenate strings.
How should I modify this to make mytid contain the string hey there?

\procedure foo() hey <<bar>> $(bar)$ 

<$button>
<$let bar=there >
<$action-setfield $tiddler="mytid" myfield=<<foo>> />
</$let>
set
</$button>

Thanx.

P.S I just discovered that to avoid the arbitrary code coloration here in the forum, you can skip the codeblock backticks and instead indent the code (with a tab character) to get a colorless code block.

  • keep in mind the old proven methods still remain such as macros or a “filtered transclusion” and join with or without spaces {{{ hey [<bar>] [[$(bars)$]] +[join[ ]] }}} but now we gain the extended back tick methods, not in a macro, but only as values to an attribute.

hey <<bar>> $(bar)$ no procedure needed (I like this)

<$button>
<$let bar=there >
<$action-setfield $tiddler="mytid" myfield=`hey $(bar)$` />
</$let>
set
</$button>

Or as a filter similar to “filtered transclusions”.

myfield=`${ filter }$`

Post Script;

I am still working at understanding the full implications and hacks but as I see it we still face the issue that caused us to need wikify but since we can concatinate with a filter where needed in an attribute, we avoid this for a subset of cases.

1 Like

Seems like we have a variety of ways to do this now, including:

<$action-setfield $tiddler="mytid" myfield={{{  [[hey $(bar)$]substitute[]] }}} />

or

<$action-setfield $tiddler="mytid2" myfield={{{  [[hey $1$]substitute<bar>] }}} />

Can you elaborate? When I try to tab, it tabs me out of the edit box!

@TW_Tones @Mark_S - thanks. I still dont get my (actual) case to work but I’m probably missing something. Gotta clock out tho.

Right. Same as when editing a tiddler- where I’ve finally thrown in the towel and just copy paste tab characters these days, so that’s what I did here too. I don’t understand why the tab character has become a jump-to-completely-elsewhere-character, unless you paste it. When jumping among buttons, sure, but not inside focussed/active editors, where it is very good for indentation.

Then, how would you focus-out of a focussed/active editor? :wink:

Ctrl+Tab used to work, but nowadays it just cycles through Firefox tabs… I’m getting too old for these! :older_man:

Fred

Guess you could put this in a tiddler so you always have a tab character handy:

Tab: <$macrocall $name="copy-to-clipboard" src={{{[charcode[9]]}}}/>

I use the autolist plugin to use the tab and shift tab to alter levels of bullets and if I am particular about tab spacing I install the code mirror plugin that allows you to insert tabs.

Tabs that move from one input element to the next is common for websites and apps that deliver forms to people and for those that like keyboard entry and not using their mouse much.

  • I note in the shortcuts tab and shift-tab are valid but on Windows + Firefox alt-tab and ctrl-tab are handled above Tiddlywiki. I am confident other keyboard handling tools would allow you to clear or redefine these globaly or by application, so you can use them in your own tiddlywiki shortcuts.

I had to use tab & shift-tab to jump all over the browser window when the mouse I was using in a computer lab broke. IE has been doing it since at least late August, 2001.

¯\_(ツ)_/¯

Or just add text immediately after the opening backticks.

I am fairly new so not sure those are really all 5.3.0 features but here would be my 3 suggestions (assuming myfield holds “There” of course this can be any tiddler/field):

\procedure foo(bar)
Hey <<bar>>
\end

\procedure baz()
<$parameters bar={{!!myfield}}>
Hey <<bar>>
</$parameters>
\end

<<foo 'There'>>

<$transclude $variable="foo" bar={{!!myfield}}/>

<<baz>>

With baz you can also do something like

As for the setting of the field I would do the following

\procedure fooCore(bar)
	<$action-setfield 
	$tiddler="mytid" 
	myfield=`Hey $(bar)$`
	/>
\end
<$button>
<$transclude $variable="fooCore" bar='There' />
set
</$button>

Thanks everyone. The concatenation proposals here actually do not seem to work. I’d show the actual code if it wasn’t too complex at the moment.

Regarding the tab character; My complaint is that it was hijacked for jumping around. That’d be fine if it wasn’t for the fact that how the heck is one supposed to type the actual tab character then??? Can’t they (including TW!) at least consistently demanded Ctrl+tab or similar for jumping, as some do?

Ha! That’s a keeper! Thanks @Mark_S

clipped image:

Thanks for your ideas everyone!

Add the literal characters text.

image

Ahaaaaa. Thanks, that is useful. BTW, maybe there’s some way for the forum admin to turn off coloration as it is always off for wikitext?

I do not think it should be turned of. IMO some colour is better than no colour. For me it does increase readability, even if it is inconsistent.

2 Likes

The default TW editor is a HTML text-area. By default they do not allow to insert tabs, since HTML usually does not show it anyway.

I did create a short HowTo, so users can create their own tab-button including the tab-shortcut to get it going.

See: How to Use the TAB Button in the Editor which I just created.

Be aware, that the TAB character cannot be used to indent paragraphs in rendered HTML output

Have fun!
mario

I’ve been catching up on the new features to update Relink, and I think all the solutions I’ve seen here are either overly complicated or don’t work.

Why not just this?

<$button>
<$let bar=there >
<$action-setfield myfield=`hey $(bar)$` />
</$let>
set
</$button>

Whoops, nope. Don’t know how I missed that, but @TW_Tones already posted pretty much that exact solution.

My bad.