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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Aug 15, 2008 3:34 am   

[2.35] Bug in %time
 
Came across this interesting bug. Or at least, I think it's a bug. Only reason I came across it is because Toxic converted a script and sent it to me and I was fooling around with it. :P In fact, there appears to be two bugs with this.

Here are the steps to recreate it.

1. Open CMUD. Escape to untitled session.
2. At command line, type #VAR testvar %time(mm-dd-yy" at "hh:nnA/P)
3. Type #say @testvar Instead of displaying 08-14-08 at 10:25 PM like it should, it displays 0
4. Open package editor, select @testvar. In the value field, instead of 08-14-08 at 10:25 PM, it displays 08-14-08a10:25 PM10:25P

Now, I realize you can achieve pretty much the same effect with %time(c), but this appears to be a bug, nonetheless.

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Aug 15, 2008 3:42 am   
 
%time (like any other function) takes a STRING argument. So you need to enclose your entire string format value in " quotes, like:

#VAR testvar %time("mm-dd-yy ""at"" hh:nnA/P")

Using two "" quotes within the quote is how you send a single quote character to the string.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Aug 15, 2008 3:51 am   
 
Ah... of course. Thanks for correcting me on that one.

However, the other issue still remains. Should #say @testvar output 0 instead of 08-14-08 at 10:25 PM?

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Aug 15, 2008 4:24 am   
 
Probably because it is auto-typed and it's getting evaluated as a number. Change it to a string and it should work. I'll add that to the bug list.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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