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

#unvar, nested variable and variable as key

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
F-3000



Joined: 06 Dec 2010
Posts: 66
Location: Next to polarbear

PostPosted: Fri Jul 20, 2012 1:05 pm    Post subject: #unvar, nested variable and variable as key Reply with quote

I ran this kind of nasty piece, that I cannot do #unvar for nested variable, if I use another variable as the key.

Example code:
Code:
#alias {test}{
   #var {test} {{1}{first}{2}{second}{3}{third}};
   #var rem 2;
   #unvar test[$rem];
   #showme $test;
}


Debugged log:
Code:
test
#DEBUG ALIAS {test} {}
[02] variable {test} {{1}{first}{2}{second}{3}{third}}
#OK. VARIABLE {test} HAS BEEN SET TO {{1}{first}{2}{second}{3}{third}}.
[02] variable rem 2
#OK. VARIABLE {rem} HAS BEEN SET TO {2}.
[02] unvariable test[$rem]
#KILL: NO MATCHES FOUND FOR VARIABLE {test[2]}.
[02] showme $test
{1}{first}{2}{second}{3}{third}
#unvar test[2]
#OK. {test[2]} IS NO LONGER A VARIABLE.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3844

PostPosted: Fri Jul 20, 2012 8:06 pm    Post subject: Reply with quote

I'll fix it for the next release.
Back to top
View user's profile Send private message Send e-mail
balthus



Joined: 07 Jul 2009
Posts: 41

PostPosted: Thu Nov 01, 2012 8:08 am    Post subject: Reply with quote

I just tried to upgrade from 2.00.4 and hit this bug (broke several of my scripts).

For info (in case anyone else has a similar problem) the bug seems to be in 2.00.7, 2.00.8 and 2.00.9(beta as of 1st November 2012), so I'm currently running 2.00.6
Back to top
View user's profile Send private message
Slysven



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

PostPosted: Thu Nov 01, 2012 6:30 pm    Post subject: Reply with quote

A work around is to do the #UNVARIABLE inside a:
Code:
#LINE {SUBSTITUTE} {VARIABLE} {...}
which forces the substitution that ain't happening, I touched upon it, I think, in this post.
Back to top
View user's profile Send private message
balthus



Joined: 07 Jul 2009
Posts: 41

PostPosted: Fri Nov 02, 2012 4:46 am    Post subject: Reply with quote

Nice trick, thanks

I also found that:

Code:
#LIST {notes} {delete} {$label};


Works too.
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 -> Bug Reports 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