I would like to expand one string array in a short metafun loop. Each box should be labelled with the appropriate string ("classicism", "Lumières", "romanticism"). How can I make the label function, inside btex etex, expand those strings. I did not find some example of string array, let's hope it's properly declared.
\setuppapersize[S6][S6]
\starttext
\startMPcode
%numeric u, l, h ;
u:=5pt ;
l:=20 ;
h:=8 ;
path p ;
p:= unitsquare xscaled (l*u) yscaled (h*u) ;
string c[] ;
c[0]:="classicisme";
c[20]:="Lumières";
c[40]:="romantisme";
for i=0 step 20 until 40 :
fill p xshifted i*u withcolor (.8-(i/200))*white;
label(btex c[i] etex, ((i+l/2)*u,(h/2)*u)) ;
endfor ;
\stopMPcode
\stoptext
My MWE does not even return c[0], c[20] and c[40] as labels, so I surely miss something with expansion.
EDIT After reading this question, I tried this
label.bot(TEX("c[i]"), ((i+l/2)*u,(h/2)*u)) ;
but it does not compile.