 
 
 
 
 
 
Re: Problems with Parsing !
- To: mathgroup at smc.vnet.net
- Subject: [mg39574] Re: [mg39570] Problems with Parsing !
- From: BobHanlon at aol.com
- Date: Mon, 24 Feb 2003 03:10:44 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2/23/03 5:59:10 AM, frodo.biggins at gmx.net writes:
> I want to write a function with 2 arguments
> Example[base_Integer,numbers_]:=Module[{...}...]
> The function works fine except that numbers are Hex numbers starting with a
> 1 (eg. 1AB23)
> In this case Mathem. interprets the numbers as 1*AB23 and gives numbers as
> AB23 to the Module.
> Is there any way to prevent this (HoldForm[numbers] in the Module do not
> work!)
> 
One way is to just make the second argument a String.
example[base_Integer,numbers_String]:=Module[
       {n=ToExpression[ToString[base]<>"^^"<>numbers]},
       {n,BaseForm[n,base]}];
example[16,"1AB23"]
Bob Hanlon

