32721
|
1 ! vim: set ft=rapid :
|
|
2
|
|
3 ! START_INDENT
|
|
4
|
|
5 %%%
|
|
6 VERSION:1
|
|
7 LANGUAGE:ENGLISH
|
|
8 %%%
|
|
9
|
|
10 module LowerCaseModule
|
|
11
|
|
12 task pers num n1 := 0;
|
|
13 local pers num n2 := 1;
|
|
14 var bool b1 := false;
|
|
15 var intnum i1;
|
|
16
|
|
17 ! put some stuff in those strings that may confuse indentation
|
|
18 const string st1 := "endmodule (";
|
|
19 pers string st_Appl_Info{3,3}:=[
|
|
20 [
|
|
21 "["
|
|
22 ,
|
|
23 "default"
|
|
24 ,
|
|
25 "case"
|
|
26 ],
|
|
27 [
|
|
28 "else"
|
|
29 ,
|
|
30 "then"
|
|
31 ,
|
|
32 "endif"
|
|
33 ],
|
|
34 [
|
|
35 "do"
|
|
36 ,
|
|
37 "}"
|
|
38 ,
|
|
39 ")"
|
|
40 ],
|
|
41 ];
|
|
42
|
|
43 pers tooldata tTool1:=[TRUE,
|
|
44 [
|
|
45 [97.4, 0, 223.1],
|
|
46 [0.924, 0, 0.383 ,0]
|
|
47 ],
|
|
48 [5,
|
|
49 [23, 0, 75],
|
|
50 [1, 0, 0, 0], 0, 0, 0
|
|
51 ]
|
|
52 ];
|
|
53 const robtarget p1:=[
|
|
54 [600, 500, 225.3],
|
|
55 [1, 0, 0, 0],
|
|
56 [1, 1, 0, 0],
|
|
57 [ 11, 12.3, 9E9, 9E9, 9E9, 9E9]
|
|
58 ];
|
|
59
|
|
60 record myRec
|
|
61 num nRecNum1
|
|
62 bool bRecBool1
|
|
63 endrecord
|
|
64
|
|
65 proc proc1(num n1,
|
|
66 num n2)
|
|
67 var string st1;
|
|
68 n1 := n1+1;
|
|
69 MoveJSync p1, vmax, z30, tool1, "proc2";
|
|
70 backward
|
|
71 MoveJSync p1, v100, fine, tool1, "proc2";
|
|
72 undo
|
|
73 n1 := n1-1;
|
|
74 error
|
|
75 trynext;
|
|
76 endproc
|
|
77
|
|
78 func num nFunc1(
|
|
79 switch s1
|
|
80 |switch s2
|
|
81 ,num n1
|
|
82 ,bool b1)
|
|
83 var num nVar;
|
|
84 if not Present(s1) return;
|
|
85 if Present(s1) then
|
|
86 Incr n1;'
|
|
87 elseif Present(s2) then
|
|
88 b1:=false;
|
|
89 else
|
|
90 while n1>0 do
|
|
91 Decr n1;
|
|
92 test n1
|
|
93
|
|
94 case 1:
|
|
95 test1;
|
|
96 case 2:
|
|
97 test2;
|
|
98 default:
|
|
99 WaitUntil false;
|
|
100 endtest
|
|
101 endwhile
|
|
102 endif
|
|
103 for i from 1 to 10 step 2 do
|
|
104 for j from 1 to 10 do
|
|
105 st_Appl_Info{i,j} := "";
|
|
106 endfor
|
|
107 endfor
|
|
108 ! return 1;
|
|
109 return 0;
|
|
110 error
|
|
111 return -1;
|
|
112 endfunc
|
|
113
|
|
114 trap Trap1
|
|
115 Reset do1;
|
|
116 endtrap
|
|
117
|
|
118 endmodule
|
|
119
|
|
120 MODULE UpperCaseModule(SYSMODULE,NOSTEPIN)
|
|
121 TASK pers num n1 := 0;
|
|
122 LOCAL pers num n2 := 1;
|
|
123 VAR bool b1 := false;
|
|
124 VAR intnum i1;
|
|
125
|
|
126 LOCAL FUNC num nFunc1(
|
|
127 switch s1
|
|
128 |switch s2
|
|
129 ,num n1
|
|
130 ,bool b1)
|
|
131 VAR num nVar;
|
|
132 IF NOT PRESENT(s1) RETURN;
|
|
133 IF PRESENT(s1) THEN
|
|
134 INCR n1;'
|
|
135 ELSEIF PRESENT(s2) THEN
|
|
136 b1:=FALSE;
|
|
137 ELSE
|
|
138 WHILE n1>0 DO
|
|
139 DECR n1;
|
|
140 TEST n1
|
|
141
|
|
142 CASE 1:
|
|
143 test1;
|
|
144 CASE 2:
|
|
145 test2;
|
|
146 DEFAULT:
|
|
147 WAITUNTIL FALSE;
|
|
148 ENDTEST
|
|
149 ENDWHILE
|
|
150 ENDIF
|
|
151 FOR i FROM 1 TO 10 STEP 2 DO
|
|
152 FOR j FROM 1 TO 10 DO
|
|
153 st_Appl_Info{i,j} := "";
|
|
154 ENDFOR
|
|
155 ENDFOR
|
|
156 ! RETURN 1;
|
|
157 RETURN 0;
|
|
158 ERROR
|
|
159 RETURN -1;
|
|
160 ENDFUNC
|
|
161
|
|
162 TRAP Trap1
|
|
163 Reset do1;
|
|
164 ENDTRAP
|
|
165
|
|
166 ENDMODULE
|
|
167
|
|
168 Module MixedCaseModule(SysModule)
|
|
169 Task pers num n1 := 0;
|
|
170 Local pers num n2 := 1;
|
|
171 Var bool b1 := false;
|
|
172 Var intnum i1;
|
|
173
|
|
174 Task Func num nFunc1(
|
|
175 switch s1
|
|
176 |switch s2
|
|
177 ,num n1
|
|
178 ,bool b1)
|
|
179 Var num nVar;
|
|
180 If Not Present(s1) Return;
|
|
181 If Present(s1) Then
|
|
182 Incr n1;'
|
|
183 ElseIf Present(s2) Then
|
|
184 b1:=false;
|
|
185 Else
|
|
186 While n1>0 Do
|
|
187 Decr n1;
|
|
188 Test n1
|
|
189
|
|
190 Case 1:
|
|
191 test1;
|
|
192 Case 2:
|
|
193 test2;
|
|
194 Default:
|
|
195 WaitUntil false;
|
|
196 EndTest
|
|
197 EndWhile
|
|
198 EndIf
|
|
199 For i From 1 To 10 Step 2 Do
|
|
200 For j From 1 To 10 Do
|
|
201 st_Appl_Info{i,j} := "";
|
|
202 EndFor
|
|
203 EndFor
|
|
204 ! Return 1;
|
|
205 Return 0;
|
|
206 Error
|
|
207 Return -1;
|
|
208 EndFunc
|
|
209
|
|
210 Trap Trap1
|
|
211 Reset do1;
|
|
212 EndTrap
|
|
213
|
|
214 EndModule
|
|
215
|
|
216 ! END_INDENT
|
|
217
|
|
218 ! START_INDENT
|
|
219 ! INDENT_EXE let g:rapidSpaceIndent = 0
|
|
220 ! INDENT_EXE set shiftwidth=4
|
|
221
|
|
222 proc bla()
|
|
223 var num i;
|
|
224 Incr i;
|
|
225 endproc
|
|
226
|
|
227 ! END_INDENT
|
|
228
|
|
229 ! START_INDENT
|
|
230 ! INDENT_EXE let g:rapidCommentIndent = 1
|
|
231 !
|
|
232 proc bla()
|
|
233 ! indent this first column comment because of g:rapidCommentIndent=1
|
|
234 endproc
|
|
235 ! END_INDENT
|
|
236
|
|
237 ! START_INDENT
|
|
238 ! INDENT_EXE let g:rapidNewStyleIndent = 1
|
|
239 pers string st_Appl_Info{3,3}:=
|
|
240 [
|
|
241 [
|
|
242 "["
|
|
243 ,
|
|
244 "default"
|
|
245 ,
|
|
246 "case"
|
|
247 ]
|
|
248 ,
|
|
249 [
|
|
250 "else"
|
|
251 ,
|
|
252 "then"
|
|
253 ,
|
|
254 "endif"
|
|
255 ]
|
|
256 ,
|
|
257 [
|
|
258 "do"
|
|
259 ,
|
|
260 "}"
|
|
261 ,
|
|
262 ")"
|
|
263 ]
|
|
264 ,
|
|
265 ];
|
|
266 ! END_INDENT
|