[metapost] Using |s| as a variable name
taco at elvenkind.com
Wed Dec 5 13:02:26 CET 2007
> and why does the following produce an error?
> string s;
> s = "aaaaaaa";
> |s| = length s;
> for i = 1 upto |s|:
Because the colon is taken to be part of the variable name,
as it is in the same character class as the pipe symbol.
for i = 1 upto |s| :
and so does this:
for i = 1 upto (|s|):
More information about the metapost