Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use the LA print class in Linqpad
#1
Sometimes I want to use some LA code in LP, but the print class does not produce any output, as shown in the figure below.
PS: It would be great if, when not using the print class in LA, it could automatically use Console.WriteLine instead and produce output. Otherwise, I need to find these functions and manually modify the code.

https://i.ibb.co/sVkq17x/A.gif
#2
In your "My Extensions" file in LinqPad add Au.dll reference and this code.
 
Code:
Copy      Help
public static class La {
    public static void Init() {
        Au.print.writer = new AuOutputWriter();
    }

    class AuOutputWriter :TextWriter {
        public override void WriteLine(string value) { Console.WriteLine(value); }
        public override Encoding Encoding => Encoding.Unicode;
    }
}

Script example:
 
Code:
Copy      Help
using Au;

La.Init();

print.it("test");
#3
thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)