For NT7 I am unaware of any undocumented print methods, you would likely need to pass in the instance of the indicator or script that calls the class. Going forward in NT8 a static method was added which can be used mostly anywhere.
Building off the prior posts sample, you could so something like the following:
partial class Indicator { public void MyFavoriteMethod(int someValue) { MyTestClass myClass = new MyTestClass([B]this[/B]); double result = myClass.DoSomeMath(someValue); Print(result); } } public class MyTestClass { [B]private Indicator myIndi;[/B] public MyTestClass([B]Indicator i[/B]) { [B]myIndi = i;[/B] myIndi.Print("Test"); } public double DoSomeMath(int val) { myIndi.Print(val); return val * 2; } }
Leave a comment: