Check-in [a9858dea4a]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Initial check-in of ImmediatePascal project (initially written sometime in 2006), which uses the Delphi 2006 compiler to quickly compile and run a bit of Delphi code. Requires the Scintilla sci_lexer.dll and the TScintilla wrapper component, none of which are included.
Timelines: family | descendants | trunk
Files: files | file ages | folders
SHA1:a9858dea4a04d9adfdd646b39ae3a265227c3cd7
User & Date: tinus 2015-01-27 13:05:16
Original Comment: Initial check-in of ImmediaPascal project, which uses the Delphi 2006 compiler to quickly compile and run a bit of Delphi code. Requires the Scintilla sci_lexer.dll (and the TScintilla wrapper component), none of which are included.
Context
2015-01-27
13:46
Switched to TMemo instead of TScintilla, and made to compile under XE7. Doesn't work, though; it still needs to call rsvars.bat first. Leaf check-in: ff0999daf0 user: tinus tags: trunk
13:05
Initial check-in of ImmediatePascal project (initially written sometime in 2006), which uses the Delphi 2006 compiler to quickly compile and run a bit of Delphi code. Requires the Scintilla sci_lexer.dll and the TScintilla wrapper component, none of which are included. check-in: a9858dea4a user: tinus tags: trunk
Changes

Added doc/DCC command-line options.txt.











































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
Borland Delphi for Win32 compiler version 18.0
Copyright (c) 1983,2005 Borland Software Corporation

Syntax: dcc32 [options] filename [options]

  -A<unit>=<alias> = Set unit alias
  -B = Build all units             
  -CC = Console target             
  -CG = GUI target                 
  -D<syms> = Define conditionals   
  -E<path> = EXE/DLL output directory
  -F<offset> = Find error          
  -GD = Detailed map file          
  -GP = Map file with publics      
  -GS = Map file with segments     
  -H = Output hint messages        
  -I<paths> = Include directories  
  -J = Generate .obj file          
  -JPHNE = Generate C++ .obj file, .hpp file, in namespace, export all
  -K<addr> = Set image base addr   
  -LE<path> = package .bpl output directory
  -LN<path> = package .dcp output directory
  -LU<package> = Use package       
  -M = Make modified units         
  -N0<path> = unit .dcu output directory
  -NH<path> = unit .hpp output directory
  -NO<path> = unit .obj output directory
  -NB<path> = unit .bpi output directory
  -NS<namespaces> = Namespace search path
  -O<paths> = Object directories   
  -P = look for 8.3 file names also
  -Q = Quiet compile               
  -R<paths> = Resource directories 
  -U<paths> = Unit directories     
  -V = Debug information in EXE    
  -VR = Generate remote debug (RSM)
  -W[+|-][warn_id] = Output warning messages
  -Z = Output 'never build' DCPs   
  -$<dir> = Compiler directive     
  --help = Show this help screen   
  --version = Show name and version
  --codepage:<cp> = specify source file encoding
  --default-namespace:<namespace> = set namespace
  --depends = output unit dependency information
  --doc = output XML documentation 
  --drc = output resource string .drc file
  --no-config = do not load default DCC32.CFG file
Compiler switches: -$<letter><state> (defaults are shown below)
  A8  Aligned record fields         
  B-  Full boolean Evaluation       
  C+  Evaluate assertions at runtime
  D+  Debug information             
  G+  Use imported data references  
  H+  Use long strings by default   
  I+  I/O checking                  
  J-  Writeable structured consts   
  L+  Local debug symbols           
  M-  Runtime type info             
  O+  Optimization                  
  P+  Open string params            
  Q-  Integer overflow checking     
  R-  Range checking                
  T-  Typed @ operator              
  U-  Pentium(tm)-safe divide       
  V+  Strict var-strings            
  W-  Generate stack frames         
  X+  Extended syntax               
  Y+  Symbol reference info         
  Z1  Minimum size of enum types    

Added doc/DImmediate.pas.









































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
// ('HKEY_CURRENT_USER\Software\Borland\BDS\4.0', RootDir)\bin\dcc32.exe
// -CC
// -E%temp%\~dimnnnn (hoeft eigenlijk niet, de .pas komt daar al te staan)
// -N0%temp%\~dimnnnn (hoeft eigenlijk niet, de .pas komt daar al te staan)
// -H
// -U"('HKEY_CURRENT_USER\Software\Borland\BDS\4.0', RootDir)\lib"
// -I<dirs to include -- settings?>
// -M ???
// -W+
// --no-config
// -$Q+
// -$R+
//
// >"C:\Program Files\Borland\BDS\4.0\bin\dcc32" -CC -EC:\MC\Temp\BH\DGMR -N0C:\MC\Temp\DGMR -U"C:\Program Files\Borland\BDS\4.0\lib" -H -M -W+ --no-config -$Q+ -$R+ C:\MC\Temp\DImmediate.pas
{
Borland Delphi for Win32 compiler version 18.0
Copyright (c) 1983,2005 Borland Software Corporation
C:\MC\Temp\DImmediate.pas(15) Error: E2029 Declaration expected but 'INTERFACE' found
C:\MC\Temp\DImmediate.pas(19) Error: E2029 ';' expected but 'IMPLEMENTATION' found
C:\MC\Temp\DImmediate.pas(19) Warning: W1011 Text after final 'END.' - ignored by compiler
C:\MC\Temp\DImmediate.pas(45)

}
// if errorlevel 1 goto showCompilerOutput
// >%temp%\~dimnnnn\DImmediate.exe
// http://delphi.about.com/cs/adptips2001/a/bltip0201_2.htm (capture output from console window)
// >del %temp%\~dimnnnn\*.* /y
// >rd %temp%\~dimnnnn
//
program DImmediate;
{$APPTYPE CONSOLE}

uses
	SysUtils, Classes, Windows {uses};
	
	
procedure RunCode();
{consts}
{types}
{vars}
begin
	{code}
	WriteLn('Hello, World!');
	MessageBox(0, 'Hello, World!', 'Testing', 64);
	raise Exception.Create('Boem!'#13#10'Paukeslag'#13#10'Daar ligt alles          PLAT');
	{/code}
	
	// TODO: eventueel de vars parsen, en hier nog ff op een rijtje zetten & tonen
	// -- let wel, dan zou Exit tot een GoTo omgebouwd moeten worden
end;

var
	ExceptionBuffer: string;
begin

	try
		RunCode;
	except
		on E: Exception do begin
			SetLength(ExceptionBuffer, 1024);
			SetLength(ExceptionBuffer, SysUtils.ExceptionErrorMessage(E, ExceptAddr(), @ExceptionBuffer[1], Length(ExceptionBuffer)));
			// return exception information via error output handle, and set errorlevel
			WriteLn(ErrOutput, ExceptionBuffer);
			ExitCode := 1;
		end;
	end;

end.

Added src/FormMain.dfm.













































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
object frmMain: TfrmMain
  Left = 0
  Top = 0
  ActiveControl = sciCode
  Caption = 'Immediate Pascal'
  ClientHeight = 574
  ClientWidth = 593
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  DesignSize = (
    593
    574)
  PixelsPerInch = 96
  TextHeight = 13
  object lblUses: TLabel
    Left = 8
    Top = 8
    Width = 23
    Height = 13
    Caption = '&Uses'
  end
  object sciCode: TScintilla
    Left = 8
    Top = 34
    Width = 577
    Height = 264
    Color = clWhite
    Font.Charset = ANSI_CHARSET
    Font.Color = clBlack
    Font.Height = -13
    Font.Name = 'Consolas'
    Font.Style = []
    OnKeyUp = sciCodeKeyUp
    OnKeyDown = sciCodeKeyDown
    Anchors = [akLeft, akTop, akRight, akBottom]
    Lines.Strings = (
      'var'
      '  Test: string;'
      'begin'
      '  Test := '#39'Hello world!'#39';'
      '  WriteLn(Test);'
      'end;')
    EOLStyle = eolCRLF
    Indentation = [KeepIndent, TabIndents, IndentationGuides]
    IndentWidth = 2
    MarginLeft = 1
    MarginRight = 1
    TabWidth = 2
    CodePage = cpAnsi
    Caret.ForeColor = clDefault
    Caret.LineBackColor = clSkyBlue
    Caret.LineVisible = True
    Caret.Width = 1
    Caret.Period = 500
    Caret.LineBackAlpha = 60
    DivOptions.ViewWSpace = sciWsInvisible
    DivOptions.UsePalette = False
    DivOptions.OverType = False
    DivOptions.ViewEOL = False
    DivOptions.EndAtLastLine = True
    DivOptions.ScrollBarH = True
    DivOptions.ScrollBarV = True
    ActiveHotSpot.BackColor = clDefault
    ActiveHotSpot.ForeColor = clBlue
    ActiveHotSpot.Underlined = True
    ActiveHotSpot.SingleLine = True
    Colors.SelFore = clHighlightText
    Colors.SelBack = clHighlight
    Colors.MarkerFore = 16777200
    Colors.MarkerBack = clSkyBlue
    Colors.FoldHi = 16777200
    Colors.FoldLo = 16777200
    Colors.WhiteSpaceFore = clYellow
    Colors.WhiteSpaceBack = clDefault
    Bookmark.BackColor = clYellow
    Bookmark.ForeColor = clRed
    Bookmark.MarkerType = sciMCircle
    Gutter0.Width = 24
    Gutter0.MarginType = gutLineNumber
    Gutter0.Sensitive = False
    Gutter1.Width = 4
    Gutter1.MarginType = gutSymbol
    Gutter1.Sensitive = True
    Gutter2.Width = 14
    Gutter2.MarginType = gutSymbol
    Gutter2.Sensitive = True
    Gutter3.Width = 0
    Gutter3.MarginType = gutSymbol
    Gutter3.Sensitive = False
    Gutter4.Width = 0
    Gutter4.MarginType = gutSymbol
    Gutter4.Sensitive = False
    WordWrapVisualFlags = [sciWWEnd]
    WordWrapVisualFlagsLocation = [sciStartByText]
    LayoutCache = sciCacheCaret
    HideSelect = False
    WordWrap = sciWrap
    EdgeColumn = 100
    EdgeColor = clSilver
    WordChars = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
    ControlCharSymbol = #0
    Folding = [foldFold, foldCompact, foldComment, foldPreprocessor, foldAtElse, foldHTML, foldHTMLPreProcessor]
    FoldMarkers.MarkerType = sciMarkBox
    FoldMarkers.FoldOpen.BackColor = clDefault
    FoldMarkers.FoldOpen.ForeColor = clDefault
    FoldMarkers.FoldOpen.MarkerType = sciMBoxMinus
    FoldMarkers.FoldClosed.BackColor = clDefault
    FoldMarkers.FoldClosed.ForeColor = clDefault
    FoldMarkers.FoldClosed.MarkerType = sciMBoxPlus
    FoldMarkers.FoldSub.BackColor = clDefault
    FoldMarkers.FoldSub.ForeColor = clDefault
    FoldMarkers.FoldSub.MarkerType = sciMVLine
    FoldMarkers.FoldTail.BackColor = clDefault
    FoldMarkers.FoldTail.ForeColor = clDefault
    FoldMarkers.FoldTail.MarkerType = sciMLCorner
    FoldMarkers.FoldEnd.BackColor = clDefault
    FoldMarkers.FoldEnd.ForeColor = clDefault
    FoldMarkers.FoldEnd.MarkerType = sciMBoxPlusConnected
    FoldMarkers.FoldOpenMid.BackColor = clDefault
    FoldMarkers.FoldOpenMid.ForeColor = clDefault
    FoldMarkers.FoldOpenMid.MarkerType = sciMBoxMinusConnected
    FoldMarkers.FoldMidTail.BackColor = clDefault
    FoldMarkers.FoldMidTail.ForeColor = clDefault
    FoldMarkers.FoldMidTail.MarkerType = sciMTCorner
    LanguageManager.LanguageList = <
      item
        Name = 'null'
        Lexer = 'null'
        Styles = <
          item
            FontName = 'Arial'
            FontSize = 0
            FontStyles = []
            ForeColor = clSilver
            BackColor = clBlack
            CharCase = CASE_MIXED
            Name = 'LineNumbers'
            StyleNumber = 33
          end
          item
            FontSize = 0
            FontStyles = [fsBold]
            ForeColor = clYellow
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Ok Braces'
            StyleNumber = 34
          end
          item
            FontSize = 0
            FontStyles = [fsBold]
            ForeColor = clRed
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Bad Braces'
            StyleNumber = 35
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clBlack
            BackColor = clSilver
            CharCase = CASE_MIXED
            Name = 'Control Chars'
            StyleNumber = 36
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clGray
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Indent Guide'
            StyleNumber = 37
          end>
        Keywords = <>
        AssignmentOperator = '='
        EndOfStatementOperator = ';'
        CommentBoxStart = '/*'
        CommentBoxEnd = '*/'
        CommentBoxMiddle = '*'
        CommentBlock = '//'
        CommentAtLineStart = True
        CommentStreamStart = '/*'
        CommentStreamEnd = '*/'
        NumStyleBits = 5
      end
      item
        Name = 'container'
        Lexer = 'container'
        Styles = <>
        Keywords = <>
        AssignmentOperator = '='
        EndOfStatementOperator = ';'
        CommentBoxStart = '/*'
        CommentBoxEnd = '*/'
        CommentBoxMiddle = '*'
        CommentBlock = '//'
        CommentAtLineStart = True
        CommentStreamStart = '/*'
        CommentStreamEnd = '*/'
        NumStyleBits = 5
      end
      item
        Name = 'Pascal'
        Lexer = 'pascal'
        Styles = <
          item
            FontSize = 8
            FontStyles = []
            ForeColor = cl3DDkShadow
            BackColor = cl3DLight
            CharCase = CASE_MIXED
            Changeable = False
            Name = 'LineNumbers'
            StyleNumber = 33
          end
          item
            FontSize = 0
            FontStyles = [fsBold]
            ForeColor = clLime
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Ok Braces'
            StyleNumber = 34
          end
          item
            FontSize = 0
            FontStyles = [fsBold]
            ForeColor = clRed
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Bad Braces'
            StyleNumber = 35
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clBlack
            BackColor = clSilver
            CharCase = CASE_MIXED
            Name = 'Control Chars'
            StyleNumber = 36
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clGray
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Indent Guide'
            StyleNumber = 37
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clDefault
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'White space'
            StyleNumber = 0
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clGreen
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Comment'
            StyleNumber = 1
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clGreen
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Line Comment'
            StyleNumber = 2
          end
          item
            FontName = 'Georgia'
            FontSize = 0
            FontStyles = []
            ForeColor = clGreen
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Doc Comment'
            StyleNumber = 3
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = 16744448
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Number'
            StyleNumber = 4
          end
          item
            FontSize = 0
            FontStyles = [fsBold]
            ForeColor = clBlue
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Keyword'
            StyleNumber = 5
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clMaroon
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Double quoted string'
            StyleNumber = 6
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clMaroon
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Single quoted string'
            StyleNumber = 7
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clDefault
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Symbols'
            StyleNumber = 8
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clTeal
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Preprocessor'
            StyleNumber = 9
          end
          item
            FontSize = 0
            FontStyles = [fsBold]
            ForeColor = clDefault
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Operators'
            StyleNumber = 10
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clNavy
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Identifier'
            StyleNumber = 11
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clDefault
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Inline Assembler'
            StyleNumber = 14
          end
          item
            FontSize = 0
            FontStyles = [fsBold]
            ForeColor = clBlue
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Class Keywords'
            StyleNumber = 16
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clGray
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Comment Keyword'
            StyleNumber = 17
          end
          item
            FontSize = 0
            FontStyles = []
            ForeColor = clRed
            BackColor = clDefault
            CharCase = CASE_MIXED
            Name = 'Comment Keyword Error'
            StyleNumber = 18
          end>
        Keywords = <
          item
            KeywordListNumber = 0
            Name = 'Keywords'
            Keywords.Strings = (
              'and'
              'array'
              'as'
              'begin'
              'case'
              'class'
              'const'
              'constructor'
              'destructor'
              'div'
              'do'
              'downto'
              'else'
              'end'
              'except'
              'file'
              'finally'
              'for'
              'function'
              'goto'
              'if'
              'implementation'
              'in'
              'inherited'
              'interface'
              'is'
              'mod'
              'not'
              'object'
              'of'
              'on'
              'or'
              'packed'
              'procedure'
              'program'
              'property'
              'raise'
              'record'
              'repeat'
              'set'
              'shl'
              'shr'
              'then'
              'threadvar'
              'to'
              'try'
              'type'
              'unit'
              'until'
              'uses'
              'var'
              'while'
              'with'
              'xor')
          end
          item
            KeywordListNumber = 1
            Name = 'Directives'
            Keywords.Strings = (
              'abstract'
              'default'
              'dynamic'
              'export'
              'index'
              'out'
              'overload'
              'override'
              'private'
              'protected'
              'public'
              'published'
              'virtual')
          end
          item
            KeywordListNumber = 2
            Name = 'Compiler directives'
            Keywords.Strings = (
              '$A'
              '$Align'
              '$AppType'
              '$B'
              '$BoolEval'
              '$D'
              '$DebugInfo'
              '$Define'
              '$DefinitionInfo'
              '$Else'
              '$EndIf'
              '$ExtendedSyntax'
              '$H'
              '$Hints'
              '$I'
              '$IfDef'
              '$IfNDef'
              '$IfOpt'
              '$Include'
              '$IOChecks'
              '$L'
              '$LocalSymbols'
              '$LongStrings'
              '$MinEnumSize'
              '$O'
              '$Optimization'
              '$OverFlowChecks'
              '$Q'
              '$R'
              '$RangeChecks'
              '$ReferenceInfo'
              '$Resource'
              '$UnDef'
              '$Warnings'
              '$X'
              '$Y'
              '$Z')
          end
          item
            KeywordListNumber = 3
            Name = 'Types'
            Keywords.Strings = (
              'AnsiChar'
              'AnsiString'
              'Boolean'
              'Byte'
              'Cardinal'
              'Char'
              'Comp'
              'Currency'
              'Double'
              'Extended'
              'Int'
              'Integer'
              'LongInt'
              'LongWord'
              'PAnsiChar'
              'PAnsiString'
              'PChar'
              'PCurrency'
              'PDateTime'
              'PExtended'
              'PInt'
              'Pointer'
              'PShortString'
              'PString'
              'PVariant'
              'PWideChar'
              'PWideString'
              'Real'
              'Real'
              'ShortInt'
              'ShortString'
              'Single'
              'SmallInt'
              'String'
              'TBits'
              'TConvType'
              'TDateTime'
              'Text'
              'TextFile'
              'TFloatFormat'
              'TFormatSettings'
              'TList'
              'TObject'
              'TOpenDialog'
              'TPoint'
              'TPrintDialog'
              'TRect'
              'TReplaceFlags'
              'TSaveDialog'
              'TSearchRec'
              'TStringList'
              'TSysCharSet'
              'TThreadFunc'
              'Variant'
              'WideChar'
              'WideString'
              'Word')
          end
          item
            KeywordListNumber = 4
            Name = 'Variables'
            Keywords.Strings = (
              'AbstractErrorProc'
              'CmdLine'
              'CurrencyDecimals'
              'CurrencyFormat'
              'CurrencyString'
              'DateSeparator'
              'DecimalSeparator'
              'ErrorAddr'
              'ExitCode'
              'FileMode'
              'Input'
              'LongDateFormat'
              'LongDayNames'
              'LongMonthNames'
              'LongTimeFormat'
              'NegCurrFormat'
              'Null'
              'Output'
              'RandSeed'
              'Result'
              'Self'
              'ShortDateFormat'
              'ShortDayNames'
              'ShortMonthNames'
              'ShortTimeFormat'
              'TConvFamily'
              'ThousandSeparator'
              'TimeAMString'
              'TimePMString'
              'TimeSeparator'
              'TwoDigitYearCenturyWindow')
          end
          item
            KeywordListNumber = 5
            Name = 'Constants'
            Keywords.Strings = (
              'Infinity'
              'MaxInt'
              'MaxLongInt'
              'MinsPerDay'
              'MonthDays'
              'NaN'
              'Nil'
              'SecsPerDay'
              'VarTypeMask')
          end
          item
            KeywordListNumber = 6
            Name = 'Functions'
            Keywords.Strings = (
              'Abs'
              'Addr'
              'AnsiCompareStr'
              'AnsiCompareText'
              'AnsiContainsStr'
              'AnsiEndsStr'
              'AnsiIndexStr'
              'AnsiLeftStr'
              'AnsiLowerCase'
              'AnsiMatchStr'
              'AnsiMidStr'
              'AnsiPos'
              'AnsiReplaceStr'
              'AnsiReverseString'
              'AnsiRightStr'
              'AnsiStartsStr'
              'AnsiUpperCase'
              'ArcCos'
              'ArcSin'
              'ArcTan'
              'Assigned'
              'BeginThread'
              'Bounds'
              'CelsiusToFahrenheit'
              'ChangeFileExt'
              'Chr'
              'CompareStr'
              'CompareText'
              'CompareValue'
              'Concat'
              'Convert'
              'Copy'
              'Cos'
              'CreateDir'
              'CurrToStr'
              'CurrToStrF'
              'Date'
              'DateTimeToFileDate'
              'DateTimeToStr'
              'DateToStr'
              'DayOfTheMonth'
              'DayOfTheWeek'
              'DayOfTheYear'
              'DayOfWeek'
              'DaysBetween'
              'DaysInAMonth'
              'DaysInAYear'
              'DaySpan'
              'DegToRad'
              'DeleteFile'
              'DirectoryExists'
              'DiskFree'
              'DiskSize'
              'DupeString'
              'EncodeDate'
              'EncodeDateTime'
              'EncodeTime'
              'EndOfADay'
              'EndOfAMonth'
              'Eof'
              'Eoln'
              'Exp'
              'ExtractFileDir'
              'ExtractFileDrive'
              'ExtractFileExt'
              'ExtractFileName'
              'ExtractFilePath'
              'FahrenheitToCelsius'
              'FileAge'
              'FileDateToDateTime'
              'FileExists'
              'FileGetAttr'
              'FilePos'
              'FileSearch'
              'FileSetAttr'
              'FileSetDate'
              'FileSize'
              'FindClose'
              'FindCmdLineSwitch'
              'FindFirst'
              'FindNext'
              'FloatToStr'
              'FloatToStrF'
              'ForceDirectories'
              'Format'
              'FormatCurr'
              'FormatDateTime'
              'FormatFloat'
              'Frac'
              'GetCurrentDir'
              'GetLastError'
              'GetMem'
              'Hi'
              'High'
              'IncDay'
              'IncMillisecond'
              'IncMinute'
              'IncMonth'
              'IncSecond'
              'IncYear'
              'InputBox'
              'InputQuery'
              'Int'
              'IntToHex'
              'IntToStr'
              'IOResult'
              'IsInfinite'
              'IsLeapYear'
              'IsMultiThread'
              'IsNaN'
              'LastDelimiter'
              'Length'
              'Ln'
              'Lo'
              'Log'
              'Low'
              'LowerCase'
              'Max'
              'Mean'
              'MessageDlg'
              'MessageDlgPos'
              'Min'
              'MonthOfTheYear'
              'Now'
              'Odd'
              'Ord'
              'ParamCount'
              'ParamStr'
              'Pi'
              'Point'
              'PointsEqual'
              'Pos'
              'Pred'
              'Printer'
              'PromptForFileName'
              'PtInRect'
              'RadToDeg'
              'Random'
              'RandomRange'
              'RecodeDate'
              'RecodeTime'
              'Rect'
              'RemoveDir'
              'RenameFile'
              'Round'
              'SeekEof'
              'SeekEoln'
              'SelectDirectory'
              'SetCurrentDir'
              'Sin'
              'SizeOf'
              'Slice'
              'Sqr'
              'Sqrt'
              'StringOfChar'
              'StringReplace'
              'StringToWideChar'
              'StrScan'
              'StrToCurr'
              'StrToDate'
              'StrToDateTime'
              'StrToFloat'
              'StrToInt'
              'StrToInt'
              'StrToInt'
              'StrToIntDef'
              'StrToTime'
              'StuffString'
              'Succ'
              'Sum'
              'Tan'
              'Time'
              'TimeToStr'
              'Tomorrow'
              'Trim'
              'TrimLeft'
              'TrimRight'
              'Trunc'
              'UpCase'
              'UpperCase'
              'VarType'
              'WideCharToString'
              'WrapText'
              'Yesterday')
          end
          item
            KeywordListNumber = 7
            Name = 'Procedures'
            Keywords.Strings = (
              'Abort'
              'Append'
              'AppendStr'
              'Assign'
              'AssignFile'
              'AssignPrn'
              'Beep'
              'BlockRead'
              'BlockWrite'
              'Break'
              'ChDir'
              'Close'
              'CloseFile'
              'Continue'
              'DateTimeToString'
              'Dec'
              'DecodeDate'
              'DecodeDateTime'
              'DecodeTime'
              'Delete'
              'Dispose'
              'EndThread'
              'Erase'
              'Exclude'
              'Exit'
              'FillChar'
              'Flush'
              'FreeAndNil'
              'FreeMem'
              'GetDir'
              'GetLocaleFormatSettings'
              'Halt'
              'Inc'
              'Include'
              'Insert'
              'MkDir'
              'Move'
              'New'
              'ProcessPath'
              'Randomize'
              'Read'
              'ReadLn'
              'ReallocMem'
              'Rename'
              'ReplaceDate'
              'ReplaceTime'
              'Reset'
              'ReWrite'
              'RmDir'
              'RunError'
              'Seek'
              'SetLength'
              'SetString'
              'ShowMessage'
              'ShowMessageFmt'
              'ShowMessagePos'
              'Str'
              'Truncate'
              'Val'
              'Write'
              'WriteLn')
          end>
        AssignmentOperator = ':='
        EndOfStatementOperator = ';'
        CommentBoxStart = '{'
        CommentBoxEnd = '}'
        CommentBoxMiddle = '*'
        CommentBlock = '//'
        CommentAtLineStart = True
        CommentStreamStart = '{'
        CommentStreamEnd = '}'
        NumStyleBits = 5
      end>
    LanguageManager.SelectedLanguage = 'Pascal'
    FoldDrawFlags = [sciBelowIfNotExpanded]
    KeyCommands = <
      item
        Command = 2300
        ShortCut = 40
      end
      item
        Command = 2301
        ShortCut = 8232
      end
      item
        Command = 2342
        ShortCut = 16424
      end
      item
        Command = 2426
        ShortCut = 41000
      end
      item
        Command = 2302
        ShortCut = 38
      end
      item
        Command = 2303
        ShortCut = 8230
      end
      item
        Command = 2343
        ShortCut = 16422
      end
      item
        Command = 2427
        ShortCut = 40998
      end
      item
        Command = 2415
        ShortCut = 49190
      end
      item
        Command = 2416
        ShortCut = 57382
      end
      item
        Command = 2413
        ShortCut = 49192
      end
      item
        Command = 2414
        ShortCut = 57384
      end
      item
        Command = 2304
        ShortCut = 37
      end
      item
        Command = 2305
        ShortCut = 8229
      end
      item
        Command = 2308
        ShortCut = 16421
      end
      item
        Command = 2309
        ShortCut = 24613
      end
      item
        Command = 2428
        ShortCut = 40997
      end
      item
        Command = 2306
        ShortCut = 39
      end
      item
        Command = 2307
        ShortCut = 8231
      end
      item
        Command = 2310
        ShortCut = 16423
      end
      item
        Command = 2311
        ShortCut = 24615
      end
      item
        Command = 2429
        ShortCut = 40999
      end
      item
        Command = 2390
        ShortCut = 49189
      end
      item
        Command = 2391
        ShortCut = 57381
      end
      item
        Command = 2392
        ShortCut = 49191
      end
      item
        Command = 2393
        ShortCut = 57383
      end
      item
        Command = 2331
        ShortCut = 36
      end
      item
        Command = 2332
        ShortCut = 8228
      end
      item
        Command = 2431
        ShortCut = 40996
      end
      item
        Command = 2316
        ShortCut = 16420
      end
      item
        Command = 2317
        ShortCut = 24612
      end
      item
        Command = 2345
        ShortCut = 32804
      end
      item
        Command = 2314
        ShortCut = 35
      end
      item
        Command = 2315
        ShortCut = 8227
      end
      item
        Command = 2318
        ShortCut = 16419
      end
      item
        Command = 2319
        ShortCut = 24611
      end
      item
        Command = 2347
        ShortCut = 32803
      end
      item
        Command = 2432
        ShortCut = 40995
      end
      item
        Command = 2320
        ShortCut = 33
      end
      item
        Command = 2321
        ShortCut = 8225
      end
      item
        Command = 2433
        ShortCut = 40993
      end
      item
        Command = 2322
        ShortCut = 34
      end
      item
        Command = 2323
        ShortCut = 8226
      end
      item
        Command = 2434
        ShortCut = 40994
      end
      item
        Command = 2180
        ShortCut = 46
      end
      item
        Command = 2177
        ShortCut = 8238
      end
      item
        Command = 2336
        ShortCut = 16430
      end
      item
        Command = 2396
        ShortCut = 24622
      end
      item
        Command = 2324
        ShortCut = 45
      end
      item
        Command = 2179
        ShortCut = 8237
      end
      item
        Command = 2178
        ShortCut = 16429
      end
      item
        Command = 2325
        ShortCut = 27
      end
      item
        Command = 2326
        ShortCut = 8
      end
      item
        Command = 2326
        ShortCut = 8200
      end
      item
        Command = 2335
        ShortCut = 16392
      end
      item
        Command = 2176
        ShortCut = 32776
      end
      item
        Command = 2395
        ShortCut = 24584
      end
      item
        Command = 2176
        ShortCut = 16474
      end
      item
        Command = 2011
        ShortCut = 16473
      end
      item
        Command = 2177
        ShortCut = 16472
      end
      item
        Command = 2178
        ShortCut = 16451
      end
      item
        Command = 2179
        ShortCut = 16470
      end
      item
        Command = 2013
        ShortCut = 16449
      end
      item
        Command = 2327
        ShortCut = 9
      end
      item
        Command = 2328
        ShortCut = 8201
      end
      item
        Command = 2329
        ShortCut = 13
      end
      item
        Command = 2329
        ShortCut = 8205
      end
      item
        Command = 2333
        ShortCut = 16491
      end
      item
        Command = 2334
        ShortCut = 16493
      end
      item
        Command = 2373
        ShortCut = 16495
      end
      item
        Command = 2337
        ShortCut = 16460
      end
      item
        Command = 2338
        ShortCut = 24652
      end
      item
        Command = 2455
        ShortCut = 24660
      end
      item
        Command = 2339
        ShortCut = 16468
      end
      item
        Command = 2469
        ShortCut = 16452
      end
      item
        Command = 2340
        ShortCut = 16469
      end
      item
        Command = 2341
        ShortCut = 24661
      end
      item
        Command = 2011
        ShortCut = 24666
      end>
  end
  object btnExecute: TBitBtn
    Left = 478
    Top = 304
    Width = 107
    Height = 25
    Action = actRun
    Anchors = [akRight, akBottom]
    Caption = '&Run'
    TabOrder = 4
  end
  object pgResults: TPageControl
    Left = 9
    Top = 335
    Width = 576
    Height = 231
    ActivePage = tsMessages
    Anchors = [akLeft, akRight, akBottom]
    TabOrder = 5
    object tsCompiler: TTabSheet
      Caption = 'Compiler output'
      DesignSize = (
        568
        203)
      object mmoCompiler: TMemo
        Left = 3
        Top = 3
        Width = 562
        Height = 197
        Anchors = [akLeft, akTop, akRight, akBottom]
        Font.Charset = OEM_CHARSET
        Font.Color = clWindowText
        Font.Height = -12
        Font.Name = 'Courier New'
        Font.Style = []
        ParentFont = False
        ReadOnly = True
        ScrollBars = ssBoth
        TabOrder = 0
      end
    end
    object tsMessages: TTabSheet
      Caption = 'Messages'
      ImageIndex = 1
      DesignSize = (
        568
        203)
      object lvwMessages: TListView
        Left = 5
        Top = 7
        Width = 560
        Height = 193
        Anchors = [akLeft, akTop, akRight, akBottom]
        Columns = <
          item
            Caption = 'File'
            Width = 52
          end
          item
            Alignment = taRightJustify
            Caption = 'Line'
            Width = 52
          end
          item
            Caption = 'Severity'
          end
          item
            Caption = 'Nr'
            Width = 73
          end
          item
            AutoSize = True
            Caption = 'Description'
            MinWidth = 50
          end>
        ColumnClick = False
        ReadOnly = True
        RowSelect = True
        TabOrder = 0
        ViewStyle = vsReport
        OnSelectItem = lvwMessagesSelectItem
      end
    end
    object tsResult: TTabSheet
      Caption = 'Result'
      ImageIndex = 2
      DesignSize = (
        568
        203)
      object mmoResult: TMemo
        Left = 5
        Top = 8
        Width = 560
        Height = 192
        Anchors = [akLeft, akTop, akRight, akBottom]
        Font.Charset = OEM_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Courier New'
        Font.Style = []
        ParentFont = False
        ReadOnly = True
        ScrollBars = ssBoth
        TabOrder = 0
      end
    end
  end
  object pbExecution: TProgressBar
    Left = 8
    Top = 304
    Width = 464
    Height = 25
    TabOrder = 3
    Visible = False
  end
  object edtUses: TEdit
    Left = 37
    Top = 5
    Width = 496
    Height = 21
    TabOrder = 0
    Text = 'SysUtils, Classes, Windows'
    OnExit = edtUsesExit
  end
  object cbxGUI: TCheckBox
    Left = 539
    Top = 7
    Width = 46
    Height = 17
    Alignment = taLeftJustify
    Caption = '&GUI'
    TabOrder = 1
  end
  object sciAutoComplete: TSciAutoComplete
    IgnoreCase = False
    ChooseSingle = False
    AutoHide = True
    DropRestOfWord = False
    CancelAtStart = True
    Editor = sciCode
    WordCharacters = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
    MaxWidth = 0
    MaxHeight = 5
    OnAutoCSelection = sciAutoCompleteAutoCSelection
    Left = 51
    Top = 220
  end
  object ActionList: TActionList
    Left = 54
    Top = 287
    object actRun: TAction
      Category = 'Run'
      Caption = '&Run'
      ShortCut = 120
      OnExecute = actRunExecute
    end
    object actCompile: TAction
      Category = 'Run'
      Caption = '&Compile'
      ShortCut = 16504
      SecondaryShortCuts.Strings = (
        'Shift+F9')
    end
  end
end

Added src/FormMain.pas.





































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
unit FormMain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, SciAutoComplete, SciLexer, SciLexerMemo, SciLexerMod, StdCtrls, Buttons, ComCtrls,
  ActnList, ToolWin;

type
  TfrmMain = class(TForm)
    sciCode: TScintilla;
    sciAutoComplete: TSciAutoComplete;
    btnExecute: TBitBtn;
    pgResults: TPageControl;
    tsCompiler: TTabSheet;
    mmoCompiler: TMemo;
    tsMessages: TTabSheet;
    tsResult: TTabSheet;
    lvwMessages: TListView;
    mmoResult: TMemo;
    pbExecution: TProgressBar;
    ActionList: TActionList;
    actRun: TAction;
    actCompile: TAction;
    lblUses: TLabel;
    edtUses: TEdit;
    cbxGUI: TCheckBox;
    procedure edtUsesExit(Sender: TObject);
    procedure actRunExecute(Sender: TObject);
    procedure lvwMessagesSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
    procedure sciAutoCompleteAutoCSelection(Sender: TObject; text: PAnsiChar);
    procedure FormCreate(Sender: TObject);
    procedure sciCodeKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure sciCodeKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmMain: TfrmMain;

implementation
  uses
    TypInfo,
    Registry, ShellAPI,
    ScintillaLanguageManager,
    RunConsoleUnit;

{$R *.dfm}

////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TfrmMain.FormCreate(Sender: TObject);
var
  Keywords: TSciKeyWordsList;
  i: Integer;
begin
  Randomize;

  Keywords := sciCode.LanguageManager.LanguageList.Find('Pascal').Keywords;
  for i := 0 to Keywords.Count - 1 do begin
    sciAutoComplete.AStrings.AddStrings(Keywords.GetKeywordList(i).Keywords);
  end;
//  sciAutoComplete.AStrings.Assign(Keywords.GetKeywordList(0).Keywords);
  sciAutoComplete.FromDocument := False;
//  sciAutoComplete.StartAutoComplete;

  sciCode.SelStart := 31;
  sciCode.SelLength := 41;
end;

////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TfrmMain.edtUsesExit(Sender: TObject);
begin
  if Pos('SysUtils', edtUses.Text) = 0 then begin
    if Length(edtUses.Text) > 0 then begin
      edtUses.Text := 'SysUtils, ' + edtUses.Text;
    end else begin
      edtUses.Text := 'SysUtils';
    end;
  end;
end;

////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TfrmMain.sciAutoCompleteAutoCSelection(Sender: TObject; text: PAnsiChar);
begin
  sciAutoComplete.Editor.SelText := text;
end;

////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TfrmMain.sciCodeKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if(Key = VK_F9) then begin
    btnExecute.Click;
  end else if (Key = 191{/}) and (Shift = [ssCtrl]) then begin
    sciCode.CommentBlock;
//  end else if (Key = VK_SPACE) and (Shift = [ssCtrl]) then begin
//    if sciAutoComplete.StartAutoCompleteWord(false) = false then begin
//      ShowMessage('not ok');
//    end;
//    Key := 0;
//    Shift := [];
//  end else begin
//    Self.Caption := 'Key = ' + IntToStr(Key) + '; Shift = ' + IntToStr(byte(Shift));
  end;
end;

////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TfrmMain.sciCodeKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
//  if (Key = VK_SPACE) and (Shift = [ssCtrl]) then begin
//    sciAutoComplete.StartAutoComplete;
//
//    Key := 0;
//    Shift := [];
//  end;
end;

////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TfrmMain.actRunExecute(Sender: TObject);
var
  TempPath: string;
  TempFile: string;
  Source: TStringList;
  FirstLine, LastLine: integer;
  Reg: TRegistry;
  BDSPath: string;
  CommandLine: string;
  ConsoleExitCode: cardinal;
  MessageItem: TListItem;
  Message: string;
  ItemText: string;
  LineNumber: integer;
  CharPos: integer;
  ErrIndex: integer;
  CursorPos: integer;
  ShFileOp: _SHFILEOPSTRUCT;
  LineIndex: Integer;
  I: Integer;
begin
  btnExecute.Enabled := False;

  // Set the progress bar
  pbExecution.Max := 4;
  pbExecution.Min := 0;
  pbExecution.Position := 0;
  pbExecution.Visible := True;

  // Determine a temp location
  SetLength(TempPath, MAX_PATH);
  SetLength(TempPath, GetTempPath(Length(TempPath), @TempPath[1]));
  TempPath := IncludeTrailingPathDelimiter(TempPath + '~ip' + IntToStr(System.Random(1000)));
  ForceDirectories(TempPath);

  // Write the Pascal source file
  TempFile := TempPath + 'DImmediate.pas';
  Source := TStringList.Create;
  try
    Source.Add('program DImmediate;');
    if cbxGUI.Checked = false then begin
      Source.Add('{$APPTYPE CONSOLE}');
    end;
    if Length(edtUses.Text) > 0 then begin
      Source.Add('uses');
      Source.Add('  ' + edtUses.Text + ';');
    end;

    Source.Add('');
    Source.Add('procedure RunCode();');
    FirstLine := Source.Count;
    // TODO: controleren of er wel een begin en end in voorkomt
    Source.AddStrings(sciCode.Lines);
    LastLine := Source.Count;
    Source.Add('');

    Source.Add('var');
    Source.Add('  ExceptionBuffer: string;');
    Source.Add('begin');
    Source.Add('');
    Source.Add('  try');
    Source.Add('    RunCode;');
    Source.Add('  except');
    Source.Add('    on E: Exception do begin');
    Source.Add('      SetLength(ExceptionBuffer, 2048);');
    Source.Add('      SetLength(ExceptionBuffer, SysUtils.ExceptionErrorMessage(E, ExceptAddr(), @ExceptionBuffer[1], Length(ExceptionBuffer)));');
    Source.Add('      // return exception information via error output handle, and set errorlevel');
    Source.Add('      WriteLn(''*** '' + ExceptionBuffer);');
    Source.Add('      //WriteLn(ErrOutput, ExceptionBuffer);'); // waarom klapt dit?
    Source.Add('      ExitCode := 1;');
    Source.Add('    end;');
    Source.Add('  end;');
    Source.Add('');
    Source.Add('end.');

    Source.SaveToFile(TempFile);
  finally
    FreeAndNil(Source);
  end;

  // Determine the compiler's path
  Reg := TRegistry.Create;
  Reg.RootKey := HKEY_CURRENT_USER;
  if Reg.OpenKeyReadOnly('Software\Borland\BDS\4.0') then begin
    BDSPath := IncludeTrailingPathDelimiter(Reg.ReadString('RootDir'));
    CommandLine := BDSPath + 'bin\dcc32.exe';
  end else begin
    raise Exception.Create('Unable to determine compiler location.');
  end;

  // Run the compiler
  pbExecution.StepIt;
  CommandLine := '"' + CommandLine + '" -CC -H -U"' + BDSPath + 'lib" -W+ --no-config -$Q+ -$R+ "' + TempFile + '"';
  mmoCompiler.Clear;
  mmoCompiler.Lines.Add(CommandLine);
  mmoCompiler.Lines.Add('');
  pgResults.ActivePage := tsCompiler;
  mmoCompiler.Lines.Add(RunConsole(CommandLine, ConsoleExitCode, true));

  // Put warnings and errors in listview
  pbExecution.StepIt;
  lvwMessages.Clear;
  for LineIndex := 5 to mmoCompiler.Lines.Count - 3 do begin
    Message := mmoCompiler.Lines[LineIndex];

    if Length(Message) > 0 then begin
      MessageItem := lvwMessages.Items.Add();

      // File name
      CharPos := Pos('(', Message);
      ItemText := Copy(Message, 0, CharPos - 1);
      Message := Copy(Message, CharPos + 1, High(integer));
      if StrComp(@ItemText[1], @TempFile[1]) <> 0 then begin
        MessageItem.Caption := ItemText;
      end;

      // Line number
      // take FirstLine, LastLine into account
      CharPos := Pos(')', Message);
      ItemText := Copy(Message, 0, CharPos - 1);
      Message := Copy(Message, CharPos + 2, High(integer));
      if Length(MessageItem.Caption) = 0 then begin
        Val(ItemText, LineNumber, ErrIndex);
        if ErrIndex = 0 then begin
          if (LineNumber <= FirstLine) or (LineNumber > LastLine) then begin
            ItemText := '';
          end else begin
            ItemText := IntToStr(LineNumber - FirstLine);
          end;
        end;
      end;
      MessageItem.SubItems.Add(ItemText);

      // Severity
      CharPos := Pos(': ', Message);
      if CharPos > 0 then begin
        ItemText := Copy(Message, 0, CharPos - 1);
        Message := Copy(Message, CharPos + 2, High(integer));
        MessageItem.SubItems.Add(ItemText);

        // Error number
        CharPos := Pos(' ', Message);
        ItemText := Copy(Message, 0, CharPos - 1);
        Message := Copy(Message, CharPos + 1, High(integer));
        MessageItem.SubItems.Add(ItemText);

        // Description
        MessageItem.SubItems.Add(Message);
      end else begin
        if (Length(MessageItem.Caption) = 0) and (Length(MessageItem.SubItems[0]) = 0) then begin
          lvwMessages.Items.Delete(MessageItem.Index);
        end;
      end;
    end;
  end;
  lvwMessages.Column[0].Width := -1;
  for I := 1 to lvwMessages.Columns.Count - 1 do begin
    lvwMessages.Column[i].Width := -2;
  end;
  if lvwMessages.Items.Count > 0 then begin
    lvwMessages.Selected := lvwMessages.Items[0];
  end;
  tsMessages.Caption := 'Messages';
  if lvwMessages.Items.Count > 0 then begin
    tsMessages.Caption := tsMessages.Caption + ' (' + IntToStr(lvwMessages.Items.Count) + ')';
  end;

  // Check for compile errors
  if ConsoleExitCode <> 0 then begin
    pgResults.ActivePage := tsMessages;
    lvwMessages.SetFocus;
  end else begin
    pbExecution.StepIt;
    // Run the compiled executable and display the results
    CursorPos := Length(mmoResult.Lines.Text);
    CommandLine := ChangeFileExt(TempFile, '.exe');
    mmoResult.Lines.Add(RunConsole(CommandLine, ConsoleExitCode, true));
    mmoResult.SelStart := CursorPos;
    mmoResult.SelLength := Length(mmoResult.Lines.Text);
    pgResults.ActivePage := tsResult;
    mmoResult.SetFocus;
  end;

  // Delete the temp folder and all its contents
  pbExecution.StepIt;
  ShFileOp.Wnd := Self.Handle;
  ShFileOp.wFunc := FO_DELETE;
  ShFileOp.pFrom := PChar(ExcludeTrailingPathDelimiter(TempPath) + #0#0);
  ShFileOp.fFlags := FOF_ALLOWUNDO or FOF_NOCONFIRMATION or FOF_NOERRORUI or FOF_SILENT;
  if SHFileOperation(ShFileOp) <> 0 then begin
    RaiseLastOSError;
  end;

  pbExecution.Position := pbExecution.Max;
  Application.ProcessMessages;

  pbExecution.Visible := False;
  btnExecute.Enabled := True;
end;

////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TfrmMain.lvwMessagesSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
var
  LineNumber: integer;
  ErrorIndex: integer;
begin
  if Length(Item.Caption) = 0 then begin
    Val(Item.SubItems[0], LineNumber, ErrorIndex);
    if ErrorIndex = 0 then begin
      sciCode.GotoLineEnsureVisible(LineNumber - 1);
      sciCode.SetFocus;
    end;
  end;
end;

end.

Added src/ImmediatePascal.bdsproj.



































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
	<PersonalityInfo>
		<Option>
			<Option Name="Personality">Delphi.Personality</Option>
			<Option Name="ProjectType"></Option>
			<Option Name="Version">1.0</Option>
			<Option Name="GUID">{90E0D6A8-6A47-4995-8E35-15654F0E3ECF}</Option>
		</Option>
	</PersonalityInfo>
	<Delphi.Personality>
		<Source>
			<Source Name="MainSource">ImmediatePascal.dpr</Source>
		</Source>
		<FileVersion>
			<FileVersion Name="Version">7.0</FileVersion>
		</FileVersion>
		<Compiler>
			<Compiler Name="A">8</Compiler>
			<Compiler Name="B">0</Compiler>
			<Compiler Name="C">1</Compiler>
			<Compiler Name="D">1</Compiler>
			<Compiler Name="E">0</Compiler>
			<Compiler Name="F">0</Compiler>
			<Compiler Name="G">1</Compiler>
			<Compiler Name="H">1</Compiler>
			<Compiler Name="I">1</Compiler>
			<Compiler Name="J">0</Compiler>
			<Compiler Name="K">0</Compiler>
			<Compiler Name="L">1</Compiler>
			<Compiler Name="M">0</Compiler>
			<Compiler Name="N">1</Compiler>
			<Compiler Name="O">1</Compiler>
			<Compiler Name="P">1</Compiler>
			<Compiler Name="Q">0</Compiler>
			<Compiler Name="R">0</Compiler>
			<Compiler Name="S">0</Compiler>
			<Compiler Name="T">0</Compiler>
			<Compiler Name="U">0</Compiler>
			<Compiler Name="V">1</Compiler>
			<Compiler Name="W">0</Compiler>
			<Compiler Name="X">1</Compiler>
			<Compiler Name="Y">1</Compiler>
			<Compiler Name="Z">1</Compiler>
			<Compiler Name="ShowHints">True</Compiler>
			<Compiler Name="ShowWarnings">True</Compiler>
			<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
			<Compiler Name="NamespacePrefix"></Compiler>
			<Compiler Name="GenerateDocumentation">False</Compiler>
			<Compiler Name="DefaultNamespace"></Compiler>
			<Compiler Name="SymbolDeprecated">True</Compiler>
			<Compiler Name="SymbolLibrary">True</Compiler>
			<Compiler Name="SymbolPlatform">True</Compiler>
			<Compiler Name="SymbolExperimental">True</Compiler>
			<Compiler Name="UnitLibrary">True</Compiler>
			<Compiler Name="UnitPlatform">True</Compiler>
			<Compiler Name="UnitDeprecated">True</Compiler>
			<Compiler Name="UnitExperimental">True</Compiler>
			<Compiler Name="HResultCompat">True</Compiler>
			<Compiler Name="HidingMember">True</Compiler>
			<Compiler Name="HiddenVirtual">True</Compiler>
			<Compiler Name="Garbage">True</Compiler>
			<Compiler Name="BoundsError">True</Compiler>
			<Compiler Name="ZeroNilCompat">True</Compiler>
			<Compiler Name="StringConstTruncated">True</Compiler>
			<Compiler Name="ForLoopVarVarPar">True</Compiler>
			<Compiler Name="TypedConstVarPar">True</Compiler>
			<Compiler Name="AsgToTypedConst">True</Compiler>
			<Compiler Name="CaseLabelRange">True</Compiler>
			<Compiler Name="ForVariable">True</Compiler>
			<Compiler Name="ConstructingAbstract">True</Compiler>
			<Compiler Name="ComparisonFalse">True</Compiler>
			<Compiler Name="ComparisonTrue">True</Compiler>
			<Compiler Name="ComparingSignedUnsigned">True</Compiler>
			<Compiler Name="CombiningSignedUnsigned">True</Compiler>
			<Compiler Name="UnsupportedConstruct">True</Compiler>
			<Compiler Name="FileOpen">True</Compiler>
			<Compiler Name="FileOpenUnitSrc">True</Compiler>
			<Compiler Name="BadGlobalSymbol">True</Compiler>
			<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
			<Compiler Name="InvalidDirective">True</Compiler>
			<Compiler Name="PackageNoLink">True</Compiler>
			<Compiler Name="PackageThreadVar">True</Compiler>
			<Compiler Name="ImplicitImport">True</Compiler>
			<Compiler Name="HPPEMITIgnored">True</Compiler>
			<Compiler Name="NoRetVal">True</Compiler>
			<Compiler Name="UseBeforeDef">True</Compiler>
			<Compiler Name="ForLoopVarUndef">True</Compiler>
			<Compiler Name="UnitNameMismatch">True</Compiler>
			<Compiler Name="NoCFGFileFound">True</Compiler>
			<Compiler Name="ImplicitVariants">True</Compiler>
			<Compiler Name="UnicodeToLocale">True</Compiler>
			<Compiler Name="LocaleToUnicode">True</Compiler>
			<Compiler Name="ImagebaseMultiple">True</Compiler>
			<Compiler Name="SuspiciousTypecast">True</Compiler>
			<Compiler Name="PrivatePropAccessor">True</Compiler>
			<Compiler Name="UnsafeType">False</Compiler>
			<Compiler Name="UnsafeCode">False</Compiler>
			<Compiler Name="UnsafeCast">False</Compiler>
			<Compiler Name="OptionTruncated">True</Compiler>
			<Compiler Name="WideCharReduced">True</Compiler>
			<Compiler Name="DuplicatesIgnored">True</Compiler>
			<Compiler Name="UnitInitSeq">True</Compiler>
			<Compiler Name="LocalPInvoke">True</Compiler>
			<Compiler Name="MessageDirective">True</Compiler>
			<Compiler Name="CodePage"></Compiler>
		</Compiler>
		<Linker>
			<Linker Name="MapFile">0</Linker>
			<Linker Name="OutputObjs">0</Linker>
			<Linker Name="GenerateHpps">False</Linker>
			<Linker Name="ConsoleApp">1</Linker>
			<Linker Name="DebugInfo">False</Linker>
			<Linker Name="RemoteSymbols">False</Linker>
			<Linker Name="GenerateDRC">False</Linker>
			<Linker Name="MinStackSize">16384</Linker>
			<Linker Name="MaxStackSize">1048576</Linker>
			<Linker Name="ImageBase">4194304</Linker>
			<Linker Name="ExeDescription"></Linker>
		</Linker>
		<Directories>
			<Directories Name="OutputDir">..\out</Directories>
			<Directories Name="UnitOutputDir">..\out\dcu</Directories>
			<Directories Name="PackageDLLOutputDir"></Directories>
			<Directories Name="PackageDCPOutputDir"></Directories>
			<Directories Name="SearchPath">C:\MC\Code\Projects\External\Libraries\Text\Scintilla\delphisci-0.23\d10dcu</Directories>
			<Directories Name="Packages"></Directories>
			<Directories Name="Conditionals"></Directories>
			<Directories Name="DebugSourceDirs"></Directories>
			<Directories Name="UsePackages">False</Directories>
		</Directories>
		<Parameters>
			<Parameters Name="RunParams"></Parameters>
			<Parameters Name="HostApplication"></Parameters>
			<Parameters Name="Launcher"></Parameters>
			<Parameters Name="UseLauncher">False</Parameters>
			<Parameters Name="DebugCWD"></Parameters>
			<Parameters Name="Debug Symbols Search Path"></Parameters>
			<Parameters Name="LoadAllSymbols">True</Parameters>
			<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
		</Parameters>
		<Language>
			<Language Name="ActiveLang"></Language>
			<Language Name="ProjectLang">$00000000</Language>
			<Language Name="RootDir"></Language>
		</Language>
		<VersionInfo>
			<VersionInfo Name="IncludeVerInfo">True</VersionInfo>
			<VersionInfo Name="AutoIncBuild">True</VersionInfo>
			<VersionInfo Name="MajorVer">1</VersionInfo>
			<VersionInfo Name="MinorVer">0</VersionInfo>
			<VersionInfo Name="Release">0</VersionInfo>
			<VersionInfo Name="Build">3</VersionInfo>
			<VersionInfo Name="Debug">False</VersionInfo>
			<VersionInfo Name="PreRelease">False</VersionInfo>
			<VersionInfo Name="Special">False</VersionInfo>
			<VersionInfo Name="Private">False</VersionInfo>
			<VersionInfo Name="DLL">False</VersionInfo>
			<VersionInfo Name="Locale">1043</VersionInfo>
			<VersionInfo Name="CodePage">1252</VersionInfo>
		</VersionInfo>
		<VersionInfoKeys>
			<VersionInfoKeys Name="CompanyName">Voronwë</VersionInfoKeys>
			<VersionInfoKeys Name="FileDescription">Immediate Pascal</VersionInfoKeys>
			<VersionInfoKeys Name="FileVersion">1.0.0.3</VersionInfoKeys>
			<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
			<VersionInfoKeys Name="LegalCopyright">© Martijn Coppoolse</VersionInfoKeys>
			<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
			<VersionInfoKeys Name="OriginalFilename">ImmediatePascal.exe</VersionInfoKeys>
			<VersionInfoKeys Name="ProductName">Immediate Pascal</VersionInfoKeys>
			<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
			<VersionInfoKeys Name="Comments"></VersionInfoKeys>
		</VersionInfoKeys>
	</Delphi.Personality>
	<StarTeamAssociation></StarTeamAssociation>
	<StarTeamNonRelativeFiles></StarTeamNonRelativeFiles>
</BorlandProject>

Added src/ImmediatePascal.cfg.

























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
-$A8
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J-
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-E"..\out"
-N0"..\out\dcu"
-LE"C:\Documents and Settings\mco\My Documents\Borland Studio Projects\Bpl"
-LN"C:\Documents and Settings\mco\My Documents\Borland Studio Projects\Bpl"
-U"C:\MC\Code\Projects\External\Libraries\Text\Scintilla\delphisci-0.23\d10dcu"
-O"C:\MC\Code\Projects\External\Libraries\Text\Scintilla\delphisci-0.23\d10dcu"
-I"C:\MC\Code\Projects\External\Libraries\Text\Scintilla\delphisci-0.23\d10dcu"
-R"C:\MC\Code\Projects\External\Libraries\Text\Scintilla\delphisci-0.23\d10dcu"
-w-UNSAFE_TYPE
-w-UNSAFE_CODE
-w-UNSAFE_CAST

Added src/ImmediatePascal.dpr.

































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
program ImmediatePascal;

uses
  Forms,
  FormMain in 'FormMain.pas' {frmMain},
  RunConsoleUnit in 'RunConsoleUnit.pas';

{$R *.res}

begin
  Application.Initialize;
  Application.Title := 'Immediate Pascal';
  Application.CreateForm(TfrmMain, frmMain);
  Application.Run;
end.

Added src/ImmediatePascal.res.

cannot compute difference between binary files

Added src/RunConsoleUnit.pas.

















































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
81
82
83
84
85
86
87
88
unit RunConsoleUnit;

interface
  function RunConsole(ACommandLine: string;
                      out AExitCode: cardinal;
                      const ASkipOemConversion: boolean = false): string;

implementation
  uses
    Windows, Forms, SysUtils;

function RunConsole(ACommandLine: string;
                    out AExitCode: cardinal;
                    const ASkipOemConversion: boolean = false): string;
const
   BufferSize = 2400;
var
  Security: TSecurityAttributes;
  ReadPipe, WritePipe: THandle;
  StartupInfo: TStartUpInfo;
  ProcessInfo: TProcessInformation;
  Buffer: PChar;
  BytesRead: DWord;
  AppRunning: DWord;
  BytesAvailable: DWord;
begin
  Result := '';
  With Security do begin
    nLength := SizeOf(TSecurityAttributes);
    bInheritHandle := true;
    lpSecurityDescriptor := nil;
  end;
  if CreatePipe(ReadPipe, WritePipe, @Security, 0) then begin
    Buffer := AllocMem(BufferSize + 1);
    try
      FillChar(StartupInfo, Sizeof(StartupInfo), #0);
      With StartupInfo do begin
        cb := SizeOf(StartupInfo);
        hStdOutput := WritePipe;
        hStdInput := ReadPipe;
  //      hStdError := ReadPipe; // TODO: see if this works
        dwFlags := STARTF_USESTDHANDLES + STARTF_USESHOWWINDOW;
        wShowWindow := SW_HIDE;
      end;
      if CreateProcess(nil,
             PChar(ACommandLine),
             @Security,
             @Security,
             true,
             NORMAL_PRIORITY_CLASS,
             nil,
             nil,
             StartupInfo,
             ProcessInfo)
      then begin
        repeat
          AppRunning := WaitForSingleObject(ProcessInfo.hProcess, 100);
          Application.ProcessMessages;
        until (AppRunning <> WAIT_TIMEOUT);

        PeekNamedPipe(ReadPipe, nil, 0, nil, @BytesAvailable, nil);
        repeat
          BytesRead := 0;
          ReadFile(ReadPipe, Buffer[0], BufferSize, BytesRead, nil);
          Buffer[BytesRead]:= #0;
          if ASkipOemConversion = false then begin
            OemToAnsi(Buffer, Buffer);
          end;
          Result := Result + String(Buffer);
        until (BytesRead < BufferSize);
      end;
    finally
      FreeMem(Buffer);
    end;
    GetExitCodeProcess(ProcessInfo.hProcess, AExitCode);
    CloseHandle(ProcessInfo.hProcess);
    CloseHandle(ProcessInfo.hThread);
    CloseHandle(ReadPipe);
    CloseHandle(WritePipe);

    Result := StringReplace(Result, #13#10, #10, [rfReplaceAll]);
    Result := StringReplace(Result, #13, #10, [rfReplaceAll]);
    Result := StringReplace(Result, #10, #13#10, [rfReplaceAll]);
  end;
end;

end.