Here is the code pruned down to a minimum to show the error:
Rebol []
view center-face layout [
fld1: field
fld2: field
flds: [fld1 fld2]
]
Here is the shortest example to show the error:
layout [ test: []]
>>Misplaced item: []
Rebol uses a number of different dialects, and the two you are using in this example are the do dialect and the view dialect. Now inside the 'layout function, you can only have the view dialect but you have mixed the two. So, the parser used by the 'layout function complains of the misplaced item. The dialect expects to see after flds: one of the faces such as field, area, label etc but instead finds a block.
Regarding your clarification comment, if you wish to create a block of fields, you can just create the block first and then provide it to the 'layout function like this so that you end up with fields named var1 to var9.
lo: [ across ]
for i 1 9 1 [
repend lo [ 'label form join "var" i to set-word! join "var" i 'field 'return ]
]
view layout lo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With