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

#loop confusion

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



Joined: 28 Dec 2009
Posts: 13

PostPosted: Wed Feb 10, 2010 3:07 pm    Post subject: #loop confusion Reply with quote

Why is it that I can not get a loop variable inside the response in an alias?
Code:
#loop 1 5 tmp {#alias {g${tmp}s} {get %1 $tmp.sack}}

The first $tmp is substituted fine but the second one isn't
This is an easy enough example, so I am doing
Code:
#forall {1;2;3;4;5}{#alias {g&0s} {get %1 &0.sack}}

instead. A bug?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Wed Feb 10, 2010 6:02 pm    Post subject: Reply with quote

It's annoying, I'll add looking into just in time substitution to my todo list.

One thing you can do is:

Code:

#alias {substitute}
{
    %0
}

#loop 1 5 tmp
{
     substitute #alias {g%0s} {get %%1 %0.sack}
}


So you can use the substitute alias as a generic way to force variable and function substitution.
Back to top
View user's profile Send private message Send e-mail
tintin42



Joined: 28 Dec 2009
Posts: 13

PostPosted: Thu Feb 11, 2010 6:13 am    Post subject: Reply with quote

Scandum wrote:
It's annoying, I'll add looking into just in time substitution to my todo list.

Thanks Smile I'll consider the workaround for the forced sub. Are there any other commands that are known to be affected by the same thing?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu Feb 11, 2010 9:56 am    Post subject: Reply with quote

As far as I know it's just setting triggers that's affected.
Back to top
View user's profile Send private message Send e-mail
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