MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Using For[] for Generating Multiple Output Cells

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104924] Re: [mg104858] Using For[] for Generating Multiple Output Cells
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Fri, 13 Nov 2009 05:55:59 -0500 (EST)
  • References: <200911121101.GAA18561@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

The output of For is Null, so of course the second code has no output.

But this does:

For[x = 65, x < 91, x++,
   n0 = Names[StringJoin["System`", FromCharacterCode[x], "*"]]
   ];
Grid[Partition[n0, 3], Alignment -> Left, Frame -> All]

or this:

n0 = Table[
    Names[StringJoin["System`", FromCharacterCode[x], "*"]], {x, 65,
     91}];
Grid[Partition[n0, 3], Alignment -> Left, Frame -> All]

or this:

n0 = Table[
    Names[StringJoin["System`", FromCharacterCode[x], "*"]], {x, 65,
     91}];
Grid[Partition[Flatten@n0, 3], Alignment -> Left, Frame -> All]

Bobby

On Thu, 12 Nov 2009 05:01:23 -0600, BenT <brtubb at pdmusic.org> wrote:

> Consider this v7 code which works as intended:
>
> x = 65;
> n0 = Names[
>    StringJoin[
>     "System`", FromCharacterCode[x], "*"
>     ]
>    ];
> Grid[Partition[n0, 3], Alignment -> Left, Frame -> All]
>
> And now consider this code which allows far more versatility, for
> consecutive multiple outputs using the For[] function. BUT for some
> reason it doesn't appear to work at all! Does anyone know why? Can it
> be "fixed" as intended?
>
> For[x = 65, x < 91, x++,
>  n0 = Names[
>    StringJoin[
>     "System`", FromCharacterCode[x], "*"
>     ]
>    ];
>  Grid[Partition[n0, 3], Alignment -> Left, Frame -> All]
>  ]
>
> --- Benjamin Tubb
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Text on a curve, revisited and modified
  • Next by Date: Re: Re: How to Calculatelength of an Spline curve between
  • Previous by thread: Using For[] for Generating Multiple Output Cells
  • Next by thread: Re: Using For[] for Generating Multiple Output Cells