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
sda
Wanderer


Joined: 18 Apr 2001
Posts: 55
Location: United Kingdom

PostPosted: Wed Feb 12, 2003 6:37 pm   

Capture negative numbers
 
I'm struggling to capture a number which may/may not be negative.

For example, I have this at the moment:
Hp:&%dhp~(&%dhpmax~) Sp:&%dsp~(&%dspmax~)

But I might have negative spellpoints and then the trigger doesn't fire.

I've thought about this:
Hp:&%dhp~(&%dhpmax~) Sp:{-|}&%dsp~(&%dspmax~)

but I need to store a negative value if indeed it turns out to be negative.

Any help here please?

Thanks,
Steve :)
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Feb 12, 2003 6:56 pm   
 
Try the %n pattern

%n match a number that starts with a + or - sign

Hp:&%dhp~(&%dhpmax~) Sp:&%nsp~(&%dspmax~)


Ton Diening
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