> I can do something more manual but i really would like to take advantage > of the expressivity of pic. Any other comment is also warmly welcome.
It looks like pic has no string variables, and the "if" works at the statement level, not expression level. To provide a somewhat constructive answer: do you really need the "for" loop here? Perhaps it might also help to restructure the code, for example like this: .PS define mybox { s = layer * margin box width w height h with .sw at (s,s) box width w height margin with .nw at last box .nw dashed $1 w = w - tr h = h - tr layer = layer + 1 } w = 3; h = 2; margin = .2; tr = 2 * margin; layer = 0 mybox("Entête Ethernet") mybox("Entête IP") mybox("Entête TCP") mybox("Donnees applicatives") .PE