On Friday 05 May 2006 13:35, Rory Walsh wrote: > Can anyone spot the problem here. The 'if then' statement for ktest and > ktest2 always returns true? No doubt it's something really stupid that I > just can't see? If you compare k-rate values, then the code for both the 'if' and 'else' branch always gets executed at i-time, because the result of the comparison is undefined at i-time. So, the flow of control just "falls through" any if/then/else with a k-rate condition at init time, to avoid the possibility of unexpected "not initialised" errors. If you want if/then/else to have any effect at i-time, compare i-rate values instead.