|
Troublemag Wanderer
Joined: 14 Jul 2004 Posts: 83
|
Posted: 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 |
|
|
|
Araadan Wanderer
Joined: 07 Jun 2009 Posts: 65
|
Posted: 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") |
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
|
|
|