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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Troublemag
Wanderer


Joined: 14 Jul 2004
Posts: 83

PostPosted: Sat Jul 03, 2010 3:48 am   

[3.22 Pro] %time not functioning within #log command
 
A trigger to open a new log file when entering RP stopped working when I upgraded from 3.20 to 3.22. The trigger itself is simple.
Code:
<trigger priority="750" id="75">
  <pattern>You enter the RP and mark your self as being In Character.</pattern>
  <value>#LOG c:/logs/@charname/%time( mmddyyyy).txt</value>
</trigger>


1. Open a blank session.
2. type #show %time(mmddyyyy). The window should show the current date in the format 07022010.
3. type #log c:/logs/%time(mmddyyyy).txt. (This will only work if you have a folder named logs in your C drive. If not, substitute an appropriate directory.)

The system should display Log is on: c:/logs/07022010.txt. What it displays is c:/logs/.txt
_________________
CMUDPro 3.22
Reply with quote
Araadan
Wanderer


Joined: 07 Jun 2009
Posts: 65

PostPosted: Sat Jul 03, 2010 4:53 am   
 
similar issue / 3.22 NOPRO
Code:
#file 1 logi/%3/%3-%time( yy_mm_dd).txt


solution - %concat and nospace in function
Code:
%concat("c:/logs/",@charname,"/",%time(mmddyyyy),".txt")
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Jul 03, 2010 5:07 am   
 
This can be demonstrated even better with the following:

Code:
#SAY {C:\Logs\Charneus\%time(mmddyyyy).txt}


It seems implicit concatenation no longer works with at least this function.

Honestly, I've always used %concat for things like this to prevent problems like this.

I will point out, too, that while %time(mmddyyyy) works, it really should be %time("mmddyyyy"), as should any argument in a function that isn't a variable.

Charneus
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jul 06, 2010 5:01 pm   
 
It's because of the ".txt" at the end that looks like a key reference to a database variable. This is one of the many cases where you shouldn't be using implicit concat. Anytime you have special characters like \ and : in the text then you really do need to put " quotes around the text and use %concat properly.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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