[bounced mail, use address know to list]
>Hi,
>
>It have a probably very stupid question to ask; but so far doing math in
>TeX did
>not come in my way.
>
>How can I make the following work in Tex? :
>
>\def\mac{10}
>\newcount\cnt
>\cnt=\mac
>\the\mac
>\bye
>
>The idea is simple. I want TeX to expand \mac and make an assignment to
>register
>\cnt. I tried \expandafter\cnt=\mac, but it doesn't work. Perhaps because
>of the
>= after \cnt.
first of all, \the\mac is wrong, since \mac is no register, so that one
should be \the\cnt
but then, again you get not what you want, because tex keeps on reading
until no numbers are found, so you need to stop reading by saying
\cnt=\mac\relax (or \cnt\mac\space)
if you want a neutral way to get a number, use \number\cnt or \number\mac
since \number is less strict in what it expects
Hans
PS. Of course a google search does not work, since mac will always lead you
to big macs i suppose -)
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | [EMAIL PROTECTED]
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
fall-back web server:
www.pragma-pod.nl
-------------------------------------------------------------------------