RE: Using Different Kinds of Characters With Do?
- To: mathgroup at smc.vnet.net
- Subject: [mg27219] RE: [mg27200] Using Different Kinds of Characters With Do?
- From: "David Park" <djmp at earthlink.net>
- Date: Mon, 12 Feb 2001 03:20:58 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Two methods: Use an indirect array of characters: chars = {"@", "&", "/"}; Do[Print[chars[[a]], b], {a, 1, 3}, {b, 0, 2}] Or use the Outer statement with a semicolon at the end to suppress normal output. Outer[Print[#1, #2] &, {"@", "&", "/"}, {0, 1, 2}]; David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ > From: hoffmann [mailto:hoffmann at casema.net] To: mathgroup at smc.vnet.net > Does anyone know of a way of getting characters like "/" into a > command like > > Do[Print[a, b], {a, 0, 9}, {b, 0, 9}] > > treating it as it would treat any digit. > > And if there is no way in the world it could be done, is there a different > way of getting similar results? > > I would be very gratefull if someone could help me... > > M. Hoffmann >