|
layman8 Beginner
Joined: 30 Nov 2005 Posts: 12 Location: fwefas
|
Posted: Mon Mar 26, 2007 4:08 pm
Variable Expanding--How can I control the expanding only happen at Nth parsing? |
Here is the case:
Providen id = myname
#alias mysettings {
#alias myspeicalalias1 { tell @id hi }
......
}
with this alias, when I input with command "mysettings", I want there have a alias " myspeicalalias1 " which is " tell @id hi ", but the real result is, the alias " myspeicalalias1 " will be " tell myname hi " !!!!
So the question is, how can I prevent the parsing from happen for the 1st time?
( A further question is , how can prevent parsing happen for the Nth time?
Appreciate your help |
|
_________________ Hi, this is layman |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Mar 26, 2007 4:38 pm |
The parameters of the #ALIAS command are treated literally for just that reason. So there are likely some number of things you are not mentioning, and I can't give you an exact answer to solve your exact problem without exact information.
Best I can say is look at the %expand and %literal functions. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
layman8 Beginner
Joined: 30 Nov 2005 Posts: 12 Location: fwefas
|
Posted: Tue Mar 27, 2007 2:55 am |
Well, actually I'm trying to put a bouch of alias, triggers in a scripts which will be done by an alias "mysettings"
So, when I input the command "mysettings", I don't want the inner alias, like "myspeicalalias1" to be expanded. I would expect the alias "myspeicalalias1" to be kept as {tell @id hi}, but not {tell myname hi}. The later is the real situation as the variable @id was expanded when I input the command "mysettings".
I looked at %expand, seems not helping. |
|
_________________ Hi, this is layman |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Tue Mar 27, 2007 3:33 am |
It sounds like you want this.
Code: |
#var myCommands {"tell @id hi|myspeicalalias1|myspeicalalias2|myspeicalalias3"}
#alias mysettings {#forall @mycommands {#Execute %i}} |
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
|
|