File: CodeFolding.pas.styled

package info (click to toggle)
scite 5.5.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,176 kB
  • sloc: cpp: 175,852; ansic: 21,482; python: 7,014; makefile: 934; sh: 257; perl: 252; ruby: 217; sql: 194; php: 63; vhdl: 51; erlang: 47; objc: 22; modula3: 21; cobol: 18; lisp: 18; asm: 17; fortran: 12; ml: 11; xml: 7; tcl: 6
file content (80 lines) | stat: -rw-r--r-- 2,407 bytes parent folder | download | duplicates (2)
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
73
74
75
76
77
78
79
80
{4}// tests for code folding
{0}
{4}// multi line comments
{2}{ 
line1
line2
}{0}

{4}// begin .. end
{9}begin{0}
{1}some{0} {1}commands{0}
{9}end{13};{0}

{9}record{0} {1}test{0}
  {1}var1{13}:{0} {1}type1{13};{0}
  {1}var2{13}:{0} {1}type2{13};{0}
  {9}end{13};{0} {4}//record
{0}  
{4}//asm
{9}asm{14}
  some statement
  {9}end{13};{0} {4}//asm
{0}  
{4}//try (from https://wiki.freepascal.org/Try)
{9}try{0}
  {4}// code that might generate an exception
{9}except{0}
  {4}// will only be executed in case of an exception
{0}  {9}on{0} {1}E{13}:{0} {1}EDatabaseError{0} {9}do{0}
    {1}ShowMessage{13}({0} {10}'Database error: '{13}+{0} {1}E{13}.{1}ClassName{0} {13}+{0} {12}#13#10{0} {13}+{0} {1}E{13}.{9}Message{0} {13});{0}
  {9}on{0} {1}E{13}:{0} {1}Exception{0} {9}do{0}
    {1}ShowMessage{13}({0} {10}'Error: '{13}+{0} {1}E{13}.{1}ClassName{0} {13}+{0} {12}#13#10{0} {13}+{0} {1}E{13}.{9}Message{0} {13});{0}
{9}end{13};{0}
  
{4}//try nested (from https://wiki.freepascal.org/Try)
{9}try{0}
  {9}try{0}
    {4}// code dealing with database that might generate an exception
{0}  {9}except{0}
    {4}// will only be executed in case of an exception
{0}    {9}on{0} {1}E{13}:{0} {1}EDatabaseError{0} {9}do{0}
      {1}ShowMessage{13}({0} {10}'Database error: '{13}+{0} {1}E{13}.{1}ClassName{0} {13}+{0} {12}#13#10{0} {13}+{0} {1}E{13}.{9}Message{0} {13});{0}
    {9}on{0} {1}E{13}:{0} {1}Exception{0} {9}do{0}
      {1}ShowMessage{13}({0} {10}'Error: '{13}+{0} {1}E{13}.{1}ClassName{0} {13}+{0} {12}#13#10{0} {13}+{0} {1}E{13}.{9}Message{0} {13});{0}
  {9}end{13};{0}
{9}finally{0}
  {4}// clean up database-related resources
{9}end{13};{0}

{4}//case
{9}case{0} {1}x{0} {9}of{0}
  {7}1{13}:{0} {9}do{0} {1}something{13};{0}
  {7}2{13}:{0} {9}do{0} {1}some{0} {1}other{0} {1}thing{13};{0}
{9}else{0}
  {9}do{0} {1}default{13};{0}
  {9}end{13};{0} {4}//case
{0}  
{4}//if then else  
{9}if{0} {1}x{13}={1}y{0} {9}then{0} 
  {9}do{0} {1}something{13};{0}
{9}else{0}
  {9}do{0} {1}some{0} {1}other{0} {1}thing{13};{0}
  
{4}//for loop  
{9}for{0} {1}i{13}:={7}1{0} {9}to{0} {7}10{0} {9}do{0}
  {1}writeln{13}({1}i{13}){0}

{4}//do until
{9}repeat{0}
  {1}write{13}({1}a{13});{0}
  {1}i{13}:={1}i{13}+{7}1{13};{0}
{9}until{0} {1}i{13}>{7}10{13};{0}

{4}//preprocessor if, else, endif
{5}{$DEFINE label}{0}
{5}{$IFDEF label}{0}
  {1}command{0} {7}1{0}
{5}{$ELSE}{0}
  {1}command{0} {7}2{0}
{5}{$ENDIF}{0}