Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Mon May 10, 2004 11:16 pm   

Alternating lines in #loopdb
 
Ok here is my problem I have a #LOOPDB that I need every other line colored Alternativly but I can't figure out how to do it. and %i doesn't work in a loopdb

Unaltered
#loopdb test {%key}

So I tried %case hopeing it would work like #CASE ie if you have two values and you ask for the third it will return the first (or something along those lines) but %case only returns if the value exists.

Exp with %case(%iskey(var,%key)) //returns key number
#loopdb test {%case(%iskey(test,%key),Do,Dont) This}
returns this in a 4 record var
Do This
Don't This
This
This


Are there any other things I can try to do to make it output like this

Do this
Don't this
do this
don't this
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue May 11, 2004 1:50 am   
 
Simply use %mod.
#LOOPDB @test {#ECHO %if(%mod(%iskey(@test,%key),2),Do,Dont) %key}
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue May 11, 2004 3:31 am   
 
*WHAP* I swear I looked right at thank Thanks Vijilante.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net