You'll need to use an eval command to combine multiple strings into a command like this: Code: $points = "-p 1 0 0 -p 1 1 0 -p 2 1 0 -p 1 1 1"; eval("curve " + $points);