I wrote my first class in InterSystems Caché. How can I run it?
Hi,
I create a cache class program. Its compile it. But how to run it?
Please send one sample program with output
Comments
Hi Ponnumani.
You cannot run class itself in Caché. You can run some classmethod of this class.
For example from terminal you can run classmethod 'PrintPersons' of class Sample.Person as follows:
USER>zn "samples"
SAMPLES>do ##class(Sample.Person).PrintPersons()
Name: Klein,Agnes E.
Name: Willeke,Imelda R.
Name: Vanzetti,Rhonda Y.
...
I encourage you to read "Caché Programming Orientation Guide". http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GORIENT
Particularly it contains information on how you can use terminal to test your programs: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GORIENT_ch_devtools#GORIENT_devtools_terminal
Thanks for your useful information.
you can run like W ##Class(packagename.classname).classmethodname() (if it quits)