# Cannot give length variable to crop package?

I don't understand why, but the following code fails with the error

! Missing \endcsname inserted.
\myStock
l.607 \AtBeginDocument
{\@nameuse{CROP@init@\CROP@driver}}
?
! Emergency stop.
\myStock
l.607 \AtBeginDocument
{\@nameuse{CROP@init@\CROP@driver}}


while if I use \newcommand instead of \setlength, it works great.

Any idea why I can't feed the crop package with length variable, while it works with the geometry package?

Thanks!

MWE:

\documentclass{article}
\usepackage{lipsum}

\newlength{\myWidth}\setlength{\myWidth}{297mm}
% Does not work
\newlength{\myStock}\setlength{\myStock}{302mm}
% Works
% \newcommand{\myStock}{302mm}
\usepackage[
paperwidth=\myWidth,
paperheight=\myWidth,
pdftex=false,dvips=false,vtex=false,
]{geometry}

\usepackage[width=\myStock,height=\myStock,center,pdflatex,frame,noinfo]{crop}

\begin{document}%
\lipsum[1-20]
\end{document}


\newlength{\myWidth}\setlength{\myWidth}{297mm}

Then the value of the options width and height is 859.27322pt instead of the length register.
• @tobiasBora It depends on the usage. I do not see much benefit as option for package crop. An advantage can be, if the length is used in calculations. – Heiko Oberdiek Nov 11 '17 at 18:31