2017-10-20 84 views
0

我試圖創建佈局創建佈局由視圖由@GrahamChiu在回答中描述的方式顯示在REBOL layout: How to create layout words automatically - word has no context?在Rebol的

REBOL [] 

; WANT TO CREATE A BLOCK: [across chvar: check label "test"] , so that I can run: 
; view layout [across chvar: check label "test"] 

toappend: [across (to-set-word "chvar") 'check 'label "test" ] 
probe toappend 

mylist: [] 
foreach i toappend [append mylist i] 
probe mylist 

view layout mylist 

後來我想創建一個循環來添加很多這樣的設置爲佈局。

probe輸出是:

[across (to-set-word "chvar") 'check 'label "test"] 
[across to-set-word "chvar" check label "test"] 

然而, 「chvar」 不獲取設置爲chvar:和我收到以下錯誤:

Invalid args: [to-set-word "chvar" check label "test"] 

顯然,(to-set-word "chvar")是沒有得到之前評估被追加。這怎麼可以糾正?

回答

1

你忘撰寫

對於Red

toappend: compose [across (to-set-word "chvar") check text "test" ] 
mylist: [] 
foreach i toappend [append mylist i] 
view layout mylist 

爲紅不知道的標籤,否則相同雷博爾