P.S.: Sorry if you're receiving 2 emails for this reply, I accidentally deleted the first one while editing it (don't ask me how) blush.
P.S2.: Damn. I always edit a post a thousand times after posting it. I actually use the preview feature, but I think I just can't preview it decently. *sigh*


I wasn't referring to $iif($ifmatch,...), I was referring to $ifmatch generally. :tongue: It's value isn't script-specific. Like in this silly example (just to demonstrate):
Code:
alias alias1 {
  if ($asctime) { echo -a $alias2 Date is $ifmatch }
}
alias alias2 {
  if ($time(h) isnum 6-11) { return Good morning. }
}


This echoes "Good morning. Date is 6" instead of "Good morning. Date is Sat Sep 13 06:21:32 2003". Shouldn't alias1's $ifmatch refer to $asctime instead of alias2's $time(h)?
I believe it's a bug, but I can see that it could be $ifmatch's intended behaviour, although I don't agree with it. I think this doesn't make sense.

The issue above, for now, can be solved putting brackets around alias1's $ifmatch, to evaluate it before $alias2. But if I used alias2 as a command instead of an identifier, calling it before, brackets wouldn't do the job. I'd have to put $ifmatch in a %var before calling alias2, then use it.

My current workaround is to let alias2 clear it's $ifmatch value itself, instead of having to use %vars from everywhere I want to call it. In this specific case, it would be something ugly like:
Code:
alias alias2 {
  var %ifmatchbug = $ifmatch
  if ($time(h) isnum 6-11) {
    return Good morning. $+ $iif(%ifmatchbug,$null)
  }
  if (%ifmatchbug) { }
}
That's why I used $iif() (and /if) there, to force %ifmatchbug to be $ifmatch again.

These code examples may not show exactly the work I have dealing with $ifmatch everytime, but I couldn't think of anything else right now (it's 6:30am here :tongue:)..

This bug/issue is already related here by praetorian.

Last edited by cold; 13/09/03 10:01 AM.

* cold edits his posts 24/7