|
prestojosh Beginner
Joined: 21 Feb 2006 Posts: 19
|
Posted: Tue Sep 26, 2006 3:12 pm
Looping problem maybe? |
I have a variable.. numitems
I also have a list of variables that are as follows
1num
1name
2num
2name
3num
3name
etc
For as many different sets of variables, there is a 1 in the numitems, so for this example @numitems=3
What I need to do is be able to output something like
@1num @1name
@2num @2name
@3num @3name
and so on for as many times/numbers there is in @numitems.
Any ideas? |
|
_________________ -Presto |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Tue Sep 26, 2006 3:46 pm |
#loop @numitems {%eval( @%concat( %i, num)) %eval( @%concat( %i, name))}
should get you started. there's probably a cleaner way of writing it though, but using %i as part of a variable name requires the eval and concat |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Tue Sep 26, 2006 6:50 pm |
Actually, it doesn't require it. You can use curly braces in strange and creative ways to make this work. (Not sure if you want the #SHOW or not...)
Code: |
#LOOP @numitems {#SHOW @{%{i}num} @{%{i}name}} |
|
|
|
|
|
|