Skip to content

Instantly share code, notes, and snippets.

@eduard93
Last active August 29, 2015 14:21
Show Gist options
  • Save eduard93/bbc88b85f03def7c3e15 to your computer and use it in GitHub Desktop.
Save eduard93/bbc88b85f03def7c3e15 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.1.1 (Build 505U)" ts="2015-05-26 15:57:11">
<Class name="App.Test">
<Super>%RegisteredObject</Super>
<TimeChanged>63698,53857.107379</TimeChanged>
<TimeCreated>63683,81271.513991</TimeCreated>
<Method name="Test">
<Description>
do ##class(App.Test).Test()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
#define HW Write "Hello, World!"
$$$HW
]]></Implementation>
</Method>
<Method name="Test2">
<Description>
do ##class(App.Test).Test2()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
#define WriteLn(%str,%cnt) for ##unique(new)=1:1:%cnt { ##Continue
Write %str,! ##Continue
}
$$$WriteLn("Hello, World!",5)
]]></Implementation>
</Method>
<Method name="Test3">
<Description>
do ##class(App.Test).Test3()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
#define ForEach(%key,%gn) Set ##unique(new)=$name(%gn) ##continue
Set %key="" ##continue
For { ##continue
Set %key=$o(@##unique(old)@(%key)) ##continue
Quit:%key=""
#define EndFor }
Set ^test(1)=111
Set ^test(2)=222
Set ^test(3)=333
$$$ForEach(key,^test)
Write "key: ",key,!
Write "value: ",^test(key),!
$$$EndFor
]]></Implementation>
</Method>
<Method name="Test4">
<Description>
do ##class(App.Test).Test4()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
#Define CompTS ##Expression("""Compiled: " _ $ZDATETIME($HOROLOG) _ """,!")
Write $$$CompTS
]]></Implementation>
</Method>
<Method name="Test5">
<Description>
do ##class(App.Test).Test5()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
#If $SYSTEM.Version.GetNumber()="2015.1.1" && $SYSTEM.Version.GetBuildNumber()="505"
Write "You are using the latest released version of Caché"
#ElseIf $SYSTEM.Version.GetNumber()="2015.2.0"
Write "You are using the latest beta version of Caché"
#Else
Write "Please consider an upgrade"
#EndIf
]]></Implementation>
</Method>
</Class>
</Export>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment