tags:

views:

30

answers:

1

Is there a way to do so including creating an other build-markup function ?

+1  A: 

Sadly,build-markup uses only global variables: link text says: Note that variables used within tags are always global variables.

Here's a slightly cranky way of doing it using an inner object (bm-1 demonstrates the problem: a and b are printed with their global values; bm-2 is the cranky work around):

a: "global-a"
b: "global-b"


bm-1: func [a b][
      print build-markup "<%a%> <%b%>"
   ]

bm-2: func [a b][
    cont: context [
       v-a: a
       v-b: b
       ]
      print build-markup "<%cont/v-a%> <%cont/v-b%>"
   ]

bm-1 "aaa" "bbb"
bm-2 "aaa" "bbb"

REBOL3 has reword rather than build-markup. That is much more flexible.

Sunanda
Will study your cranky way, thanks :) Viva R3 !
Rebol Tutorial