[REBOL] Re: Antwort: Re: Antwort: Switch!
From: al:bri:xtra at: 20-Nov-2000 23:04
These lines:
> [clear sub-list
> ; temp-html: copy sub-toc-html-template
> append sub-list rejoin [{<a href="} file {" target
> ="touchscreencontent"><img src="./images/round-button.jpg" border="0" />
> }title {</a>}]
> append a newline
> append a sub-list]
are in a block. What's in a block can be put into a function. For
example:
A-function: func [][
clear sub-list
temp-html: copy sub-toc-html-template
append sub-list rejoin [
{<a href="} file {" target =" touchscreencontent">
<img src="./images/round-button.jpg" border="0" />
}title {</a>}
]
append a newline
append a sub-list
]
Repeat for a total of 26 times.
Notice that these 26 functions have duplicated words inside them. The parts
that are different about each function can be supplied as values for the
function. For example:
Michelle: func [a] [
append a reduce [
"." newline "This is on the end of a."
]
]
>> Michelle "I shall say zis only once"
== {I shall say zis only once.
This is on the end of a.}
Andrew Martin
It grows late...
ICQ: 26227169
http://members.nbci.com/AndrewMartin/