TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Help with correct variable escape syntax

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help
View previous topic :: View next topic  
Author Message
atraeyu



Joined: 12 Dec 2007
Posts: 165

PostPosted: Thu Oct 02, 2014 12:04 pm    Post subject: Help with correct variable escape syntax Reply with quote

Sorry, I'm kicking myself for not being able to figure this out, seems so simple ... but I can't figure out the correct syntax for shoving the $ISODATE variable into the path (probably because the next character is a period):

Code:
#format ISODATE  {%t} {%Y-%m-%d};
#var LOGFILE data/log/$ISODATE.log;
#var LOGFILE data/log/{$ISODATE}.log;
#var LOGFILE1 data/log/${ISODATE}.log;


Outputs:
Quote:
#VARIABLE {LOGFILE}={data/log/}
#VARIABLE {LOGFILE1}={data/log/{2014-10-02}.log}
#VARIABLE {LOGFILE2}={data/log/}


Any ideas?
Back to top
View user's profile Send private message AIM Address
PowerGod



Joined: 04 Aug 2014
Posts: 346

PostPosted: Thu Oct 02, 2014 2:31 pm    Post subject: Reply with quote

I'm curious too about escaping dots...

anyway a working solution could be this

Code:

#format LOGFILE {data/log/%t.log} {%Y-%m-%d}
#echo {$LOGFILE}
data/log/2014-10-02.log
Back to top
View user's profile Send private message
atraeyu



Joined: 12 Dec 2007
Posts: 165

PostPosted: Thu Oct 02, 2014 3:34 pm    Post subject: Reply with quote

Awesome, thank you. Smile
Back to top
View user's profile Send private message AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu Oct 02, 2014 6:29 pm    Post subject: Reply with quote

Can also use:

#var LOGFILE data/log/$ISODATE\.log;
Back to top
View user's profile Send private message Send e-mail
atraeyu



Joined: 12 Dec 2007
Posts: 165

PostPosted: Thu Oct 02, 2014 6:49 pm    Post subject: Reply with quote

Scandum wrote:
Can also use:

#var LOGFILE data/log/$ISODATE\.log;


That doesn't seem to work:

Code:
#OK. VARIABLE {LOGFILE} HAS BEEN SET TO {data/log/2014-10-02\.log}.
Back to top
View user's profile Send private message AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu Oct 02, 2014 7:37 pm    Post subject: Reply with quote

Hrm, works in some instances, but not this one. I guess format is the way to go. Smile
Back to top
View user's profile Send private message Send e-mail
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Wed Oct 08, 2014 11:35 am    Post subject: Reply with quote

Might you need to escape the '\' with another '\' or even need to escape both the original '.' AND the wanted '\' - depending on whether it is in a file being read or is typed in directly so you could need :
Code:
#var LOGFILE data/log/$ISODATE\\.log;

or even:
Code:
#var LOGFILE data/log/$ISODATE\\\.log;
Confused
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group