Re: table iteration problem
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: table iteration problem
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2011年10月18日 08:18:54 +0200
2011年10月18日 Victor Young <littlehaker@gmail.com>:
> For example, I have following codes:
> t = {
> x=1,
> y=2,
> a=3,
> b=4
> }
> If I want the output to be like follow:
> x 1
> y 2
> a 3
> b 4
> just in the order of how I construct the table, how could I do? Thanks!
After that `t={…}` the order of construction is gone. No way to get
it back. There are several ways to do what you want, but all of them
rely on keeping the list {'x','y','a','b'} somewhere.
Dirk