Last active
October 18, 2019 22:17
-
-
Save henryhamon/a711eb59f099f5a42c340235fb7b646a to your computer and use it in GitHub Desktop.
vscode cos snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$$$ThrowOnError": { | |
"prefix": "toe", | |
"body": "$$$$THROWONERROR(tSC, $1)", | |
"description": "Throw On Error Macro" | |
}, | |
"$TryCatch": { | |
"prefix": "$try", | |
"body": [ | |
"Set tSC = $$$$OK", | |
"Try {", | |
"$1 ", | |
"} Catch tException {", | |
"\tSet:$$$$ISOK(tSC) tSC = tException.AsStatus()", | |
"}", | |
"Quit tSC" | |
], | |
"description": "Try Catch" | |
}, | |
"##class": { | |
"prefix": "#cls", | |
"body": "##class($1)", | |
"description": "Caché Class" | |
}, | |
"#open": { | |
"prefix": "%open", | |
"body": "##class($1).%OpenId($2)", | |
"description": "Caché Open Class" | |
}, | |
"#new": { | |
"prefix": "%new", | |
"body": "##class($1).%New()", | |
"description": "Caché New Class" | |
}, | |
"%OnNew": { | |
"prefix": "%onnew", | |
"body": [ | |
"Method %OnNew() As %Status [ Private, ServerOnly = 1 ]", | |
"{", | |
"Set tSC = $$$$OK", | |
"Try {", | |
" $1 ", | |
"} Catch tException {", | |
"\tSet:$$$$ISOK(tSC) tSC = tException.AsStatus()", | |
"}", | |
"\tQuit tSC", | |
"}" | |
], | |
"description": "OnNew" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment