\documentclass{article}
\input{pstricks040717}
\usepackage{multido}
%\psset{dashadjust=false}
\begin{document}
\title{Almost arbitrary dash patterns in pstricks} \author{Tobias
  N{\"a}hring} \maketitle Just some simple tests. Mainly to check
command parsing. Spaces and newlines before the first and after the
last dash length present a special problem that is solved now.

Very long (automatically created) lists of dash patterns cause
postscript errors. The error message easily comprehensible:

`Error: limit check in setdash'

Does this error depend on the postscript interpreter?
Should it be replaced by a \LaTeX-error message? 

\vspace*{1cm}
\begin{pspicture}(-0.5\textwidth,-0.25\textheight)(0.5\textwidth,0.25\textheight)
 \psgrid[gridcolor=green,subgridcolor=yellow]
  \psset{linestyle=dashed}
  \pscurve[dash=5mm 1mm 1mm 1mm
  ,linewidth=0.1](-5,4)(-4,3)(-3,4)(-2,3)
  \psline[dash=5mm 1mm 1mm
  1mm 1mm    1mm 1mm 1mm 1mm 1mm
  ](-5,0.9)(5,0.9)
  \psccurve[linestyle=solid](0,0)(1,0)(1,1)(0,1)
  \psccurve[linestyle=dashed,dash=
  5mm 2mm
  0.1 0.2,linetype=0](0,0)(-2.5,0)(-2.5,-2.5)(0,-2.5)
  %% The next example shows the postscript error.
  %% Try to increase the loop count. Maybe, the critical loop
  %% count dependents on the postscript interpreter.
  \def\tmp{}
  \multido{\n=0.1+0.1}{5}{\xdef\tmp{\tmp\n\space0.1\space}}
  \message{>>>>}
  \expandafter\pscurve[dash=\tmp,linecolor=red,linewidth=2pt](5,-4)(5,2)(4.5,3.5)(3,4)(-5,4)
\end{pspicture}
\end{document}
