|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Tue Nov 14, 2006 4:54 am
[1.15] User defined functions don't work in #IF (expression) |
Reproduce:
Create the function variable: #VAR Triple {%1*3}
Test it to make sure it works: #ECHO @Triple(4)
Bug occurs when you use it like this: #IF (@Triple(3)=9) {#ECHO True}
Using user-functions in the test part of an #IF statement causes a syntax error. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Tue Nov 14, 2006 4:59 am |
Sorry if I was unclear in my post. This is the same bug I posted about. The way to make it work temporarily is to do this
#if (%eval(@tripple(3)=9)) {} {}
There are other issues too, like you may find that you need to use %int for example. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Nov 14, 2006 5:25 am |
Yeah, I'm getting this a lot in some of my scripts. I'm not going to totally overhaul them like this for something that's going to be fixed, though, and end up with a) a load of time wasted working round the problem and b) have a load of extra functions in my scripts to slow them down.
Original posts for this are here and here. |
|
|
|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Tue Nov 14, 2006 10:57 am |
You were perfectly clear Arminas... I just missed your post. Oops.
|
|
|
|
|
|