Skip to content

Instantly share code, notes, and snippets.

@henryhamon
Last active October 18, 2019 22:17
Show Gist options
  • Save henryhamon/a711eb59f099f5a42c340235fb7b646a to your computer and use it in GitHub Desktop.
Save henryhamon/a711eb59f099f5a42c340235fb7b646a to your computer and use it in GitHub Desktop.
vscode cos snippets
{
"$$$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