|
Delbaeth Newbie
Joined: 19 Oct 2001 Posts: 4 Location: United Kingdom
|
Posted: Fri Oct 10, 2003 11:53 pm
Upgrade 6.12 to 6.62 and aliases stop working |
I've just upgraded my zmud from 6.12, which I've been using quite happily for ages now.
Here's a fairly simple alias I've had set up for even longer than I've used 6.12. It's always worked fine until now. Alias is called 'arkasu'.
#IF (%1="fill") { outp arkasu; fill @pipeArkasu with arkasu; inp arkasu }
light @pipeArkasu
#IF (%null( %1)) {smoke @pipeArkasu}
Intended results:
I type arkasu fill, it does:
outp arkasu;fill pipe10000 with arkasu;inp arkasu;light pipe10000
I type arkasu, it does:
light pipe10000;smoke pipe10000
Current results:
I type arkasu fill, it does (correct):
outp arkasu;fill pipe10000 with arkasu;inp arkasu;light pipe10000
I type arkasu, it does (bad):
outp arkasu;fill pipe10000 with arkasu;inp arkasu;light pipe10000;smoke pipe10000
Has the way %1 is interpretted been changed since 6.12? Or the way %null works?
I've seen another post saying for this purpose %numparams()=0 should be used instead of %null, but I'm wondering if someone can emplain what has actually changed here since this will probably affect alot of aliases, many far more complicated.
Thanks in advance,
Del |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Sat Oct 11, 2003 12:17 am |
%1 is substituted quite early on in the parsing phase of a script. When you use your alias without arguments, %1 is replaced with nothing; that is, it is excised completely. This makes your statement:
#IF (="fill") {etc.}
Clearly, that's not what you want... put the %1 in quotes. For example,
#IF ("%1"="fill") {etc.}
That should work for you. |
|
|
|
Davos Adept
Joined: 30 Jan 2003 Posts: 228 Location: USA
|
Posted: Sat Oct 11, 2003 12:47 am |
Or you could simply just do
#IF (%1="fill") { outp arkasu; fill @pipeArkasu with arkasu; inp arkasu;light @pipearkasu} {light @pipeArkasu;smoke @pipeArkasu}
That would simplify your issues much |
|
|
|
|
|
|
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
|
|