This page is part of the Tcl/Tk page of the Airplug documentation.
Back to the Tcl/Tk page /
Back to Airplug documentation page.
—
set alpha "Hel" set beta "lo" puts stdout $alpha$beta
This gives:
Hello
append
:set alphabeta "Hel" append alphabeta "lo" puts stdout $alpha$beta
This gives:
Hello
set alpha "Hel" puts stdout $alpha"Hel"
This gives:
Hel"lo"
concat
tcl function applies on lists. It is possible to concat some strings by using a list but this is not the good way: set alphabeta [concat "Hel" "lo"] puts stdout $alphabeta
This gives a list of two members, displayed with a space between them:
Hel lo
A list can be merged to give a string (here without spaces between members) as follows:
set alphabeta [join [concat "Hel" "lo"] "" puts stdout $alphabeta
This gives:
Hello
However this is not efficient.
set alpha "Hel" set alphabeta ${alpha}lo puts stdout $alphabeta
This gives:
Hello
append
:set alphabeta "Hel" append alphabeta "lo"
set alpha "Hel" set alphabeta ${alpha}lo
<br>
This page is part of the Tcl/Tk page of the Airplug documentation.
Back to the Tcl/Tk page /
Back to Airplug documentation page.