Try doing it this wayNV_VS(ncap,= ,n,/ NV_MAG(n))nThe rule that fluent use for this macro is ... V, stands for vector ... S, for scalar ... and D, for order .. try to arrange any operation using the three letters. The macros mentioned in the UDF manual are only examples. Some examples in many chapters used macros that were not mentioned.

Thanks a lot. It worked out this time. I tried out the same command earlier, but it gave me an error. I'm not sure what data type I declared ncap as earlier and maybe it was because of that.n