RE: Problems with ToString[]
- To: mathgroup at smc.vnet.net
- Subject: [mg35962] RE: [mg35937] Problems with ToString[]
- From: "DrBob" <majort at cox-internet.com>
- Date: Fri, 9 Aug 2002 05:18:11 -0400 (EDT)
- Reply-to: <drbob at bigfoot.com>
- Sender: owner-wri-mathgroup at wolfram.com
You gave ToString three parameters (2, 3 and "Schmitt"), but ToString has only TWO parameters. You intended to give ToString only ONE parameter. One way to fix the problem is this: new[par___] := (Print["The Parameters: ", par]; Print["The Parameters: ", ToString[par]];); new[{2, 3, "Schmitt"}]; or, better perhaps, new[par___] := (Print["The Parameters: ", par]; Print["The Parameters: ", StringJoin@Drop[Rest@ Characters@ToString@{par}, -1]];); new[2, 3, "Schmitt"]; Bobby Treat -----Original Message----- From: Hermann Schmitt [mailto:schmitther at netcologne.de] To: mathgroup at smc.vnet.net Subject: [mg35962] [mg35937] Problems with ToString[] Hello, I have the following program: new[par___] := ( Print["The Parameters: ", par]; Print["The Parameters: ", ToString[par]]; ); new[2, 3, "Schmitt"]; and get the following result: The Parameters: 23Schmitt ToString ToString::nonopt: Options expected (instead of Schmitt) beyond position 2 in ToString[2, 3, Schmitt]. An option must be a rule or a list of rules.The Parameters: ToString[2, 3, Schmitt] In[14]:= According to the Mathematica book no further parameters are necessary for ToString[]. Why does the system not like "Schmitt" as parameter? My final aim is to construct a function call with variable function name and the parameters "par"