Anton wrote:
> I can't think of a way to do this:
> I wanted to write something like this:
>
> print rejoin ["my name is: " name 3 * (tab) "my hobby is: " hobby 2 *
(tab)]
>
> where each n * (tab) is supposed to give back something like:
> tab tab tab .... for n=3 etc.
>
> Of course, it doesn't work, but is there a nice way to write this?
> It's like some sort of "macro multiplier"
> How would you guys do it?
>
> I don't really want to write:
> loop 3 [print tab]
> in the middle, breaking apart the string...

>> Multi_Tab: function [Number [integer!]] [Tabs] [
[    Tabs: make string! Number
[    loop Number [append Tabs tab]
[    Tabs
[    ]

>> Multi_Tab 4
== {^-^-^-^-}

>> hobby: "Fooling around in Rebol"
== "Fooling around in Rebol"

>> name: "Andrew"
== "Andrew"

>> print rejoin [
[        "my name is: " name Multi_Tab 3
[        "my hobby is: " hobby Multi_Tab 2
[        "<END!"]
my name is: Andrew          my hobby is: Fooling around in Rebol
<END!

print "And I'm sure you can extend it for yourself now. :-)"

Andrew Martin
Foolin' around in Rebol...
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-


Reply via email to