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
dime
Novice


Joined: 15 Dec 2002
Posts: 35

PostPosted: Thu Jun 12, 2003 8:08 am   

negative numbers in triggers?
 
for #TR {You have got (%d) practice sessions}

is there any way to have the (%d) capture negative numbers too?
You have got -5 practice sessions, and 9 spell practice sessions left.

also, a quick test..
#var a -5
#if (a<0) {#show yes} {#show no}
output: no

i'm using 6.16...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jun 12, 2003 8:32 am   
 
Use %n for signed numbers and numbers containing commas.
#TR {You have got (%n) practice sessions}

A quick test
#VAR a -5
#IF (@a < 0) {#SHOW yes} {#SHOW no}
output: yes

@a is -5, which is less than 0. a is a which is not (letters are greater than 0).

LightBulb
Advanced Member
Reply with quote
dime
Novice


Joined: 15 Dec 2002
Posts: 35

PostPosted: Thu Jun 12, 2003 3:47 pm   
 
i keep on forgeting the @ in if statements and never learn my lesson..
thanks
Reply with quote
dime
Novice


Joined: 15 Dec 2002
Posts: 35

PostPosted: Thu Jun 12, 2003 3:47 pm   
 
i keep on forgeting the @ in if statements and never learn my lesson..
thanks
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