|
Bobo the Bee Newbie
Joined: 14 Jan 2008 Posts: 1 Location: Appa State U
|
Posted: Wed Feb 13, 2008 8:58 pm
alias question |
Is there a way to take a variable and send it as one of my aliases?
Like #EXECUTE but check to see if it's an alias first, and if so, send that? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Wed Feb 13, 2008 9:15 pm |
#alias blah {#SAY hi}
test=blah
#EXEC {@test}
prints out the expected 'hi' |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Wed Feb 13, 2008 10:16 pm |
#alias blah {#SAY hi}
test=blah
#if (%trigger(@test)==1) {#exec {@test}}
The only trouble being that if you have any other setting named blah then it will attempt. So it is not an exact science if you will. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Wed Feb 13, 2008 11:03 pm |
Should you use %alias to test if something is an alias?
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Wed Feb 13, 2008 11:50 pm |
Nope, %alias expands an alias. It was one of the commands created to make Zmud functions work more like real functions.
%class and %trigger both do the same thing. But obviously I wasn't trying to see if the variable contained the name of a class... |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Thu Feb 14, 2008 12:46 am |
#EXEC {%alias(@test)}
does work |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Thu Feb 14, 2008 1:14 am |
Ok, so now I feel stupid. I was wrong.
#if (%alias(@test)) {#show yes} {#show no}
Does work... Hrm Cool but |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
|
|