From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6839 Path: main.gmane.org!not-for-mail From: Slawek Zak Newsgroups: gmane.comp.tex.context Subject: Re: String -> register conversion Date: Wed, 06 Feb 2002 16:07:05 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <87it9ahco6.fsf@pf39.warszawa.sdi.tpnet.pl> References: <5.1.0.14.1.20020206094654.04235158@server-1> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035397345 14219 80.91.224.250 (23 Oct 2002 18:22:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:22:25 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: Hans Hagen In-Reply-To: <5.1.0.14.1.20020206094654.04235158@server-1> (Hans Hagen's message of "Wed, 06 Feb 2002 09:52:52 +0100") Xref: main.gmane.org gmane.comp.tex.context:6839 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6839 On Wed, 06 Feb 2002, Hans Hagen verbalised: > [bounced mail, use address know to list] Fixed, thanks. >>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 Sure. My fault. I meant \the\cnt of course. > 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) Ouch. \relax, I should've thought of it. Thanks. > 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 Yep. That reminds me to put The TeXbook lecture on my to-read list again ;) > PS. Of course a google search does not work, since mac will always lead you to > big macs i suppose -) Apple would come up as the first search result on Google, actually ;) /S -- hundred-and-one symptoms of being an internet addict: 234. You started college as a chemistry major, and walk out four years later as an Internet provider. * Suavek Zak / PGP: finger://zaks@prioris.mini.pw.edu.pl