-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathobjectscript-int.json
72 lines (72 loc) · 1.48 KB
/
objectscript-int.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
"ForOrder": {
"prefix": ["For"],
"body": [
"Set ${1:key} = \"\"",
"For {",
"\tSet $1 = \\$ORDER(${2:array}($1))",
"\tQuit:$1=\"\"",
"\t${3:// process $2($1)}",
"}"
],
"description": "Iterate array with $Order"
},
"SQL Statement": {
"prefix": ["sql"],
"body": [
"Set rs = ##class(%SQL.Statement).%ExecDirect(,\"SELECT ${1:*} FROM ${2:table}\")",
"While rs.%Next() {",
"\t${0:Write rs.ID, !}",
"}"
],
"description": "Prepare and execute SQL Query, then iterate result set 'rs'"
},
"For": {
"prefix": ["For"],
"body": [
"For ${1:i} = ${2:1}:${3:1}:${4:9} {",
"\t${0:Write $1, !}",
"}"
],
"description": "Typical For loop"
},
"For Each": {
"prefix": ["For"],
"body": [
"For ${1:value} = \"${2:Red}\",\"${3:Green}\",\"${4:Blue}\" {",
"\t${0:Write $1, !}",
"}"
],
"description": "Loop through series of values"
},
"Do While": {
"prefix": ["Do", "While"],
"body": [
"Do {",
"\t$0",
"} While (${1:1 /* condition */})"
],
"description": "Do While loop"
},
"While": {
"prefix": ["While"],
"body": [
"While (${1:1 /* condition */}) {",
"\t$0",
"}"
],
"description": "While loop"
},
"Try Catch": {
"prefix": ["Try"],
"body": [
"Try {",
"\t$0",
"}",
"Catch ex {",
"\tSet tSC=ex.AsStatus()",
"}"
],
"description": "Try Catch"
}
}