Search code examples
cachingexportintersystems

InterSystems Cache class export


I am working with one project where I need to get the content of .cls file. I know how to get .xml file, however I need exact code which contains all comments and other stuff. I found a class %Dictionary.ClassDefinition which can give a class name, properties. But is there any way to get raw class code.


Solution

  • It depends on which version you use.

    • 2014.1 and later - you may you class %Compiler.UDL.TextServices, even this way may not work as expected.
    • 2016.2 and later - you can just use $system.OBJ.ExportUDL()

    In any versions earlier 2014.1, it still possible, but you can do it only by yourself by reading Class which stores in classes in package %Dictionary.