Written by

Developer
Question Wilfredo Jose · Apr 30, 2018

Display a CLS in a terminal session

Hi WRC,

In a terminal session it is possible to ZLOAD a MAC or INT program and ZP to display it.

Please advise - Is there a similar way of doing this for a CLS?

Best,

Wil

Comments

Tom Fitzgibbon · Apr 30, 2018

CLS is kept in the system globals in each namespace. With some work you could probably write a COS routine to display the CLS in a human readable format.

Tom Fitzgibbon | gototomATg...l.com

0
Robert Cemper  May 1, 2018 to Dmitry Maslennikov

Great!

SAMPLES>w !! do $system.OBJ.ExportUDL("Sample.Company.cls")


/// This sample persistent class represents a company.<br>
Class Sample.Company Extends (%Persistent, %Populate, %XML.Adaptor)
{

/// Define an index for <property>Name</property>.
Index NameIdx On Name [ Type = index ];

/// Define a unique index for <property>TaxID</property>.
Index TaxIDIdx On TaxID [ Type = index, Unique ];

/// The company's name.
Property Name As %String(MAXLEN = 80, POPSPEC = "Company()") [ Required ];

/// The company's mission statement.
Property Mission As %String(MAXLEN = 200, POPSPEC = "Mission()");

/// The unique Tax ID number for the company.
Property TaxID As %String [ Required ];

/// The last reported revenue for the company.
Property Revenue As %Integer;

/// The <class>Employee</class> objects associated with this <class>Company</class>.
Relationship Employees As Employee [ Cardinality = many, Inverse = Company ];

------<skip rest> -------

0
Dmitry Maslennikov · May 1, 2018

We are not WRC, it is developer community.

As Tom already mentioned, in Caché class is not just as routine, it is like a bunch of objects defined in %Dictionary package, methods code can be found with %Dictionary.MethodDefinition or %Dictionary.CompiledMethodDefinition, depends on the situation.

But it is possible to get a text of class like you can in Studio

%Compiler.UDL.TextServices with methods GetTextAsStream, GetTextAsFile and etc., and convert back from text to class

In versions since 2016.2 you can use export to file in UDL format with $system.OBJ.ExportUDL()

0