On Jan 24, 2008, at 9:03 AM, Aditya Mahajan wrote:
Hi Thomas,
On Thu, 24 Jan 2008, Thomas A. Schmitz wrote:
I wanted to be clever and do it in a for-loop like this:
for i=1 upto 10: pickup pencircle scaled (i*0.5) pt ; draw fullcircle scaled 5mm withcolor transparent (1,0.04,black) ; endfor ;
Is this because the expression "pencircle scaled" expects a "numeric primary" as argument? And is there any way around this?
scaled expects a dimension. (i*0.5)pt is not a dimension. You need to either write (i*0.5pt) or ((i*0.5)*1pt). The extra parenthesis are needed to keep the metapost parser happy.
Aditya
Hi Aditya, arrrrgh. So easy - and I had no idea how to do it. Works perfectly! I'm glad I'm in the humanities and not in engineering; my bridges would collapse real soon... Thanks so much; this loop looks so much nicer than having ten lines of code doing the same circle all over again! All best Thomas