-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBLOKK.CDW
1525 lines (1234 loc) · 35.5 KB
/
BLOKK.CDW
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
(****************** BLOKK rutinok glob lis v ltoz¢i *******************)
Var Kicsi,Nagy : Integer;
Fpoz,Lpoz,
Elsok,Utolsok: Integer;
Fpoz2,Lpoz2 : Integer;
Procedure Valtozasok;
Begin
BlockMode := False;
Mozgott := True;
Valtozas[EditNum] := True;
End;
Procedure Block_Begin(Oszlop : Boolean);
Begin
Beepel(300);
OszlopMode := Oszlop;
If Oszlop Then Beepel(600);
BlockMode := True;
Block[0] := MainOfIndex[Ypos];
InvPoz[0] := Xpos;
Block_End;
InvertLine(Ypos,True);
{ActiveBlock[EditNum] := (Block[0] < Block[1]);}
End;
Procedure Xchg(Var X,Y : Word);
Begin
InLine($1E/ { Push DS }
$C4/$7E/<X/ { LES DI,[BP+XX] }
$C5/$76/<Y/ { LDS SI,[BP+YY] }
$26/ { ES: }
$FF/$35/ { Push [DI] }
$FF/$34/ { Push [SI] }
$26/ { ES: }
$8F/$05/ { Pop [DI] }
$8F/$04/ { Pop [SI] }
$1F); { Pop DS }
End;
Procedure KisebbNagyobb(Var X,Y:Word);
Var Z : Integer;
Begin
Z := X;
X := Kisebb(Z,Y);
Y := Nagyobb(Z,Y)
End;
Var Forwar : Byte;
EgySorMode : Boolean;
Procedure ClearImage;
Var Cikl : Byte;
Begin
For Cikl := FirstLine To LastLine Do
Image[Cikl]^.Chars[C80+c79] := #0;
End;
Procedure ClearImageBlock;
Begin
ClearImage;
PosToPos(Block[0],InvPoz[0],True);
End;
Procedure KicsiNagy(Var Kicsi,Nagy: Integer);
Begin
Forwar := Byte(Block[0] <= Block[1]);
Kicsi := Kisebb(Block[0],Block[1]);
Nagy := Nagyobb(Block[0],Block[1]);
End;
Procedure Set_KicsiNagy;
Begin
KicsiNagy(Kicsi,Nagy);
FirstAndLast(Kicsi,Fpoz,Lpoz2);
FirstAndLast(Nagy,Fpoz2,Lpoz);
Kezdodo := InvPoz[Forwar XOR 1];
Vegzodo := InvPoz[Forwar];
End;
Procedure Valtozasok_Set_KicsiNagy;
Begin
Valtozasok;
Set_KicsiNagy;
End;
Procedure Set_Kicsi_Nagy_Kezd_Veg;
Var Dummy : Integer;
Begin
KicsiNagy(Kicsi,Nagy);
Kezdodo := InvPoz[Forwar XOR 1];
Vegzodo := InvPoz[Forwar];
EgySorMode := (Kicsi = Nagy);
Kezd := InvPoz[Forwar XOR 1];
Veg := InvPoz[Forwar];
If OszlopMode AND (Kezd > Veg) Then Xchg(Kezd,Veg);
If EgySorMode Then
Begin
KisebbNagyobb(Kezd,Veg);
OszlopMode := False;
End;
FirstAndLast(Kicsi,Fpoz,Dummy);
Elsok := Dummy-Fpoz;
FirstAndLast(Nagy,Dummy,Lpoz);
Utolsok := Lpoz-Dummy;
End;
Function UresSor(P : Lpoint; Kezd,Veg : Integer):Boolean;
Var Cik : Integer;
Ch : Char;
Begin
Cik := Kezd;
Ch := P^.Chars[C80+Cik];
While (Cik < Veg) AND (Ch = #00) Do
Begin
Inc(Cik);
Ch := P^.Chars[C80+Cik];
End;
UresSor := (Ch = #00);
End;
Procedure ElsoUresSor(Var Fpoz,Cikl,Hp,NewMain : Integer;
Var Kezd : Word;
Var ElsoUres,UjSor : Boolean);
Var Bc : Integer;
P : Lpoint;
Begin
For Bc := Fpoz To Cikl-1 Do
Begin
Heap_Pos(P,PointerTomb^[Bc]);
If NOT UresSor(P,0,Kezd-1) Then
ElsoUres := False;
FreeEms1(PointerTomb^[Bc])
End;
If ElsoUres Then
Begin
For Bc := Fpoz To Cikl-1 Do
Begin
Dec(Hp);
DelHeapLine(Fpoz);
Dec(All_Lines[EditNum]);
End;
End;
UjSor := False;
End;
Procedure DelEmptyLines(Var Kcik,Hp: Integer;
Var UtolsoUres,FullBlokk : Boolean);
Var P : Lpoint;
Bc: Integer;
Begin
For Bc := KCik To Hp-1 Do
Begin
Heap_Pos(P,PointerTomb^[Bc]);
If NOT UresSor(P,0,c77) Then
UtolsoUres := False;
FreeEms1(PointerTomb^[Bc])
End;
If (NOT FullBlokk) AND UtolsoUres AND (Kcik > StartLine[EditNum]) Then
For Bc := KCik To Hp-1 Do
Begin
{$IFDEF PROTECT}
If NOT ProtectedLine(Bc) Then
{$ENDIF}
Begin
DelHeapLine(Kcik);
Dec(All_Lines[EditNum]);
End;
End;
End;
Procedure SetNewMain(Var NewMain: Integer);
Begin
If NewMain > EndLine[EditNum] Then
Begin
NewMain := EndLine[EditNum];
If NOT MainLine(NewMain) Then
NewMain := PrevMain(NewMain);
End;
End;
Procedure Move_Block_End;
Var TeditNum,
Dummy,Cikl,
NewMain,Cikl2,KCik,
FullS,Hp : Integer;
Pufferban : Integer;
Blockban : Integer;
Source,Dest,P : Lpoint;
KiszurE,
Elsoben,Utolsoban,Mai : Boolean;
_1,_2 : Word;
FullBlokk,ElsoUres,
UtolsoUres,UjSor,
UjUtolsoSor : Boolean;
Procedure Kiszurogat;
Begin
Kiszur(KiszurE,Source,Kezd,Veg-Kezd+1); { Editor }
Kiszur(True,Dest,Veg+1,c78-(Veg+1)); { Puffer vege }
Kiszur(True,Dest,0,Kezd); { A puffer eleje}
End;
Begin
If BlockMode Then
Begin
Set_Kicsi_Nagy_Kezd_Veg;
Pufferban := EndLine[BufferNum] - StartLine[BufferNum]+1;
Blockban := Lpoz - Fpoz + 1;
If (NOT(OszlopMode)) Or (FreeLines-(Blockban-Pufferban) > 5) Then { 5 = biztonsagi rahagyas }
Begin
Valtozasok;
Valtozas[BufferNum] := True;
NewMain := Kicsi;
TEditNum := EditNum;
FreeEdit(BufferNum);
New_Kell[BufferNum] := False;
Hp := Fpoz;
FullBlokk := ((Fpoz = StartLine[EditNum]) AND (Lpoz = EndLine[EditNum]));
If NOT OszlopMode Then
Begin
UjSor := True;
UjUtolsoSor := True;
ElsoUres := True;
UtolsoUres := True;
End;
For Cikl := Fpoz To Lpoz Do
Begin
{$IFDEF PROTECT}
KiszurE := NOT ProtectedLine(Cikl);
{$ELSE}
KiszurE := True;
{$ENDIF}
EditNum := BufferNum;
NewHeapLine(EndLine[EditNum]+1);
Heap_Pos(Dest,PointerTomb^[EndLine[EditNum]]);
_1 := PointerTomb^[EndLine[EditNum]];
EditNum := TEditNum;
Mai := MainLine(Hp);
If Mai Then
Begin
FullS := DownInd(Hp)+UpInd(Hp)+1;
Inc(All_Lines[BufferNum],FullS);
End;
Heap_Pos(Source,PointerTomb^[Hp]);
_2 := PointerTomb^[Hp];
Move(Source^,Dest^,C160);
Elsoben := InInt(Cikl,Fpoz,Fpoz+Elsok);
Utolsoban := InInt(Cikl,Lpoz-Utolsok,Lpoz);
If Elsoben Then
Begin
If EgySorMode Then Kiszur(True,Dest,0,Kezd)
Else
If (Not OszlopMode) AND (Kezd > LeftMar[EditNum]) Then
Kiszur(True,Dest,LeftMar[EditNum],Kezd-LeftMar[EditNum]); { A puffer eleje }
If OszlopMode Then
Begin
Kiszur(KiszurE,Source,Kezd,Veg-Kezd+1); { Editor }
Kiszur(True,Dest,Veg+1,c78-(Veg+1)); { Puffer vege }
Kiszur(True,Dest,0,Kezd); { A puffer eleje}
End
Else
Begin
If Utolsoban Then
Begin
Kiszur(KiszurE,Source,Kezd,Veg-Kezd+1); { Editor }
Kiszur(True,Dest,Veg-Kezd+1,c78-(Veg-Kezd+1)); { A puffer vege }
If (Kezd <= LeftMar[EditNum]) AND (Veg >= RightMar[EditNum]) Then
If NOT FullBlokk Then
Begin
DelHeapLine(Fpoz);
Dec(All_Lines[EditNum]);
End;
End
Else
Kiszur(KiszurE,Source,Kezd,c78-Kezd);
End;
Inc(Hp)
End
Else
If Utolsoban Then
Begin
If Not OszlopMode Then
Begin
Kiszur(KiszurE,Source,0,Veg+1);
Kiszur(True,Dest,Veg+1,c78-(Veg+1));
If UjSor Then
ElsoUresSor(Fpoz,Cikl,Hp,NewMain,Kezd,ElsoUres,UjSor);
If UjUtolsoSor Then
Begin
KCik := Hp;
UjUtolsoSor := False;
End;
End
Else Kiszurogat;
Inc(Hp);
End
Else
Begin
If OszlopMode Then
Begin
Kiszurogat;
Inc(Hp);
End
Else
Begin
{$IFDEF PROTECT}
If NOT ProtectedLine(Hp) Then
{$ENDIF}
Begin
If UjSor Then
ElsoUresSor(Fpoz,Cikl,Hp,NewMain,Kezd,ElsoUres,UjSor);
DelHeapLine(Hp);
If Mai Then Dec(All_Lines[EditNum],FullS);
End
{$IFDEF PROTECT}
Else Inc(Hp)
{$ENDIF}
;
{If NewMain > Fpoz Then Dec(NewMain);}
End;
End;
FreeEms1(_1);
FreeEms1(_2);
End;
If (NOT OszlopMode) AND (NOT UjUtolsoSor) Then
DelEmptyLines(Kcik,Hp,UtolsoUres,FullBlokk);
SetNewMain(NewMain);
ClearImage;
TeditNum := EditNum;
EditNum := BufferNum;
SeekToFirstLine;
EditNum := TEditNum;
OszlopVolt := OszlopMode;
PosToPos(NewMain,Kezd,True);
End
Else
Begin
Error(4,BlSt1);
End;
End;
End;
Procedure Delete_Block_End;
Var Dummy,Cikl,Bc,KCik,Hp,NewMain :integer;
FullS : Integer;
Source,Dest,P : Lpoint;
KiszurE,Elsoben,Utolsoban,Mai : Boolean;
_1 : Word;
FullBlokk,ElsoUres,UtolsoUres,
UjSor,UjUtolsoSor : Boolean;
Procedure Kiszuras;
Begin
Kiszur(KiszurE,Source,Kezd,Veg-Kezd+1) { Editor }
End;
Begin
If BlockMode Then
Begin
Valtozasok;
Set_Kicsi_Nagy_Kezd_Veg;
NewMain := Kicsi;
HP := Fpoz;
FullBlokk := ((Fpoz = StartLine[EditNum]) AND (Lpoz = EndLine[EditNum]));
If NOT OszlopMode Then
Begin
UjSor := True;
UjUtolsoSor := True;
ElsoUres := True;
UtolsoUres := True;
End;
For Cikl := Fpoz To Lpoz Do
Begin
{$IFDEF PROTECT}
KiszurE := NOT ProtectedLine(Cikl);
{$ELSE}
KiszurE := True;
{$ENDIF}
MAi := MainLine(Hp);
If Mai Then
FullS := DownInd(Hp)+UpInd(Hp)+1;
Heap_Pos(Source,PointerTomb^[Hp]);
_1 := PointerTomb^[Hp];
Elsoben := InInt(Cikl,Fpoz,Fpoz+Elsok);
Utolsoban := InInt(Cikl,Lpoz-Utolsok,Lpoz);
If Elsoben Then
Begin
If OszlopMode OR Utolsoban Then
Begin
Kiszuras;
If (NOT OszlopMode) AND Utolsoban Then
If (Kezd <= LeftMar[EditNum]) AND (Veg >= RightMar[EditNum]) Then
If NOT FullBlokk Then
Begin
DelHeapLine(Fpoz);
Dec(All_Lines[EditNum]);
End;
End
Else
Begin
Kiszur(KiszurE,Source,Kezd,c78-Kezd);
End;
Inc(Hp)
End
Else
Begin
If Utolsoban Then
Begin
If OszlopMode Then Kiszuras
Else
Begin
Kiszur(KiszurE,Source,0,Veg+1);
If UjSor Then
ElsoUresSor(Fpoz,Cikl,Hp,NewMain,Kezd,ElsoUres,UjSor);
If UjUtolsoSor Then
Begin
KCik := Hp;
UjUtolsoSor := False;
End;
End;
Inc(Hp)
End
Else
Begin
If OszlopMode Then
Begin
Kiszuras;
Inc(Hp);
End
Else
Begin
{$IFDEF PROTECT}
If NOT ProtectedLine(Hp) Then
{$ENDIF}
Begin
If UjSor Then
ElsoUresSor(Fpoz,Cikl,Hp,NewMain,Kezd,ElsoUres,UjSor);
DelHeapLine(Hp);
If Mai Then Dec(All_Lines[EditNum],FullS);
End
{$IFDEF PROTECT}
Else Inc(Hp)
{$ENDIF}
;
{ If NewMain > Fpoz Then Dec(NewMain);}
End;
End;
End;
FreeEms1(_1)
End;
If (NOT OszlopMode) AND (NOT UjUtolsoSor) Then
DelEmptyLines(Kcik,Hp,UtolsoUres,FullBlokk);
SetNewMain(NewMain);
ClearImage;
PosToPos(NewMain,Kezd,True);
End;
End;
Procedure Copy_Block_End;
Var TeditNum : Integer;
Dummy,Cikl : Integer;
Source,Dest : Lpoint;
Pufferban : Integer;
Blockban : Integer;
Elsoben,Utolsoban,
Mai : Boolean;
_1,_2 : Word;
Procedure Kiszurogat;
Begin
Kiszur(True,Dest,Veg+1,c78-(Veg+1)); { Puffer vege }
Kiszur(True,Dest,0,Kezd); { A puffer eleje}
End;
Begin
If BlockMode Then
Begin
Set_Kicsi_Nagy_Kezd_Veg;
Pufferban := EndLine[BufferNum] - StartLine[BufferNum]+1;
Blockban := Lpoz - Fpoz + 1;
If FreeLines-(Blockban-Pufferban) > 5 Then { 5 = biztonsagi rahagyas }
Begin
TEditNum := EditNum;
BlockMode := False;
FreeEdit(BufferNum);
Valtozas[BufferNum] := True;
New_Kell[BufferNum] := False;
For Cikl := Fpoz To Lpoz Do
Begin
EditNum := BufferNum;
NewHeapLine(EndLine[EditNum]+1);
Heap_Pos(Dest,PointerTomb^[EndLine[EditNum]]);
_1 := PointerTomb^[EndLine[EditNum]];
EditNum := TEditNum;
If MainLine(Cikl) Then
Inc(All_Lines[BufferNum],DownInd(Cikl)+UpInd(Cikl)+1);
Heap_Pos(Source,PointerTomb^[Cikl]);
_2 := PointerTomb^[Cikl];
Move(Source^,Dest^,C160);
Elsoben := InInt(Cikl,Fpoz,Fpoz+Elsok);
Utolsoban := InInt(Cikl,Lpoz-Utolsok,Lpoz);
If Elsoben Then
Begin
If EgySorMode Then Kiszur(True,Dest,0,Kezd) Else
If Not(OszlopMode) AND (Kezd > LeftMar[EditNum]) Then
Kiszur(True,Dest,LeftMar[EditNum],Kezd-LeftMar[EditNum]); { A puffer eleje }
If OszlopMode Then Kiszurogat
Else
If Utolsoban Then
Kiszur(True,Dest,Veg-Kezd+1,c78-(Veg-Kezd+1)); { A puffer vege }
End
Else
Begin
If OszlopMode Then Kiszurogat
Else
If Utolsoban Then
Kiszur(True,Dest,Veg+1,c78-(Veg+1));
End;
FreeEms1(_1);
FreeEms1(_2);
End; { for cikl }
ClearImage;
SaveLastP;
TeditNum := EditNum;
EditNum := BufferNum;
SeekToFirstLine; { Ez all a puffer elejere }
EditNum := TEditNum;
OszlopVolt := OszlopMode;
SeekToLastP;
End
Else
Begin
Error(4,BlSt1);
End;
End { If BlockMode }
End;
Procedure Abort_Block;
Var Cikl : Integer;
Begin
If BlockMode Then
Begin
BlockMode := False;
ClearImage;
FreshPage;
End { If BlockMode }
End;
Procedure Change_Block_Font(Font: Byte);
Var
Kot : Array [0..MaxMaxChars] Of Byte;
Uto,Kotok,Cik : Byte;
Attr : Byte;
Cikl,Temp : Integer;
Vege,Kezd : Word;
Source : Lpoint;
NewMain : Integer;
_1 : Word;
Tip,OldTip : CharType;
X : Byte;
Begin
If BlockMode AND (NOT ExtendedE(Font)) Then
Begin
If DoltE(Font) Then Tip := Dolt Else
If VastagE(Font) Then Tip := Vastag Else Tip := Normal;
If OldFont <> 255 Then
Begin
If DoltE(OldFont) Then OldTip := Dolt Else
If VastagE(OldFont) Then OldTip := Vastag Else OldTip := Normal;
End
Else OldTip := Every;
Valtozasok_Set_KicsiNagy;
For Cikl := Fpoz To Lpoz Do
Begin
If (Not OnlyMain) OR (MainLine(Cikl)) Then
Begin
If OszlopMode Then
Begin
Kezd := Kezdodo;
Vege := Vegzodo;
End
Else
Begin
Kezd := 0;
Vege := c77;
If InInt(Cikl,Fpoz,Lpoz2) Then Kezd := Kezdodo;
If InInt(Cikl,Fpoz2,Lpoz) Then Vege := Vegzodo;
End;
If Vege < Kezd Then
Xchg(Kezd,Vege);
Heap_Pos(Source,PointerTomb^[Cikl]);
If Kezd = 0 Then Attr := Source^.Attribs[0] And $F0;
If OldFont = 255 Then
Begin
Uto := c77;
Kotok := 00;
While Uto > 0 Do
Begin
If (Source^.Attribs[Uto] AND 15 = 0) AND
(Source^.Chars[C80+Uto] = '-') Then
Begin
Inc(Kotok);
Kot[Kotok] := Uto;
End;
Dec(Uto);
End;
{$IFDEF PROTECT}
If NOT ProtectedLine(Cikl) Then
{$ENDIF}
For X := Kezd To Vege Do
Begin
If (Source^.Attribs[X] AND 15) In ExtSet Then
Begin
Source^.Chars[C80+X] :=
NewExtCharType((Source^.Attribs[X] AND 15),
Source^.Chars[C80+X],OldTip,Tip);
End
Else Source^.Attribs[X] := Font;
End;
{ FillChar(Source^.Attribs[Kezd],Vege-Kezd+1,Font); }
If Kotok > 0 Then
For Cik := 1 To Kotok Do
Source^.Attribs[Kot[Cik]] := 00;
End
Else
Begin
{$IFDEF PROTECT}
If NOT ProtectedLine(Cikl) Then
{$ENDIF}
For X := Kezd To Vege Do
Begin
If (Source^.Attribs[X] AND 15) In ExtSet Then
Begin
Source^.Chars[C80+X] :=
NewExtCharType((Source^.Attribs[X] AND 15),
Source^.Chars[C80+X],OldTip,Tip);
End
Else If (Source^.Attribs[X] AND 15) = OldFont Then
Source^.Attribs[X] := Font;
End;
{ChangeLineFont(Source^.Attribs[Kezd],Kezd,Vege+1,OldFont,Font);}
End;
If Kezd = 0 Then Source^.Attribs[0] := Source^.Attribs[0] OR Attr;
FreeEms1(PointerTomb^[Cikl])
End;
End;
OldFont := 255;
ClearImageBlock;
End
Else
Begin
Beepel(660);
Beepel(440);
End;
End;
Procedure UpperCase_Block(Par : CaseType);
Var
PP,
Att,X : Byte;
C : Char;
Cikl,Temp : Integer;
Vege,Kezd : Word;
Source : Lpoint;
NewMain : Integer;
Procedure Upper;
Begin
If C In Kis_A_Kis_Z Then Source^.Chars[C80+X] := Char(Byte(C)-$20)
Else If Att > 0 Then
Begin
PP := Pos(C,UpCasePoint[Att,1]^);
If PP > 0 Then Source^.Chars[C80+X] := UpCasePoint[Att,2]^[PP];
End;
End;
Procedure Lower;
Begin
If C In Nagy_A_Nagy_Z Then Source^.Chars[C80+X] := Char(Byte(C)+$20)
Else If Att > 0 Then
Begin
PP := Pos(C,UpCasePoint[Att,2]^);
If PP > 0 Then Source^.Chars[C80+X] := UpCasePoint[Att,1]^[PP];
End;
End;
Procedure Invert;
Begin
If C In Kis_A_Kis_Z Then Source^.Chars[C80+X] := Char(Byte(C)-$20) Else
If C In Nagy_A_Nagy_Z Then Source^.Chars[C80+X] := Char(Byte(C)+$20) Else
If Att > 0 Then
Begin
PP := Pos(C,UpCasePoint[Att,1]^);
If PP > 0 Then Source^.Chars[C80+X] := UpCasePoint[Att,2]^[PP] Else
Begin
PP := Pos(C,UpCasePoint[Att,2]^);
If PP > 0 Then Source^.Chars[C80+X] := UpCasePoint[Att,1]^[PP];
End;
End;
End;
Begin (* UpperCase_Block *)
If BlockMode Then
Begin
Valtozasok_Set_KicsiNagy;
For Cikl := Fpoz To Lpoz Do
Begin
If (Not OnlyMain) OR (MainLine(Cikl)) Then
Begin
If OszlopMode Then
Begin
Kezd := Kezdodo;
Vege := Vegzodo;
End
Else
Begin
Kezd := 0;
Vege := c77;
If InInt(Cikl,Fpoz,Lpoz2) Then Kezd := Kezdodo;
If InInt(Cikl,Fpoz2,Lpoz) Then Vege := Vegzodo;
End;
If Vege < Kezd Then
Xchg(Kezd,Vege);
Heap_Pos(Source,PointerTomb^[Cikl]);
For X := Kezd To Vege Do
Begin
C := Source^.Chars[C80+X];
Att := Source^.Attribs[X] AND 15;
If FontAttr[Att] <> $F0 Then
Case Par Of
BlockUp : Upper;
BlockLow : Lower;
BlockInv : Invert;
End;
End;
FreeEms1(PointerTomb^[Cikl]);
End;
End;
ClearImageBlock;
End;
End;
Procedure Calculate_Block(Par : CalcType);
Var
PP,
Att,X : Byte;
C : Char;
Cikl,Temp : Integer;
Vege,Kezd : Word;
Source : Lpoint;
Code,NewMain : Integer;
Oszto,Num : Real;
VegeVan : Boolean;
Ws : Str160;
Begin { Calculate_Block }
GlobalNum := 0.0;
Num := 0.0;
Ws := '';
Valtozasok_Set_KicsiNagy;
For Cikl := Fpoz To Lpoz Do
Begin
If (Not OnlyMain) OR (MainLine(Cikl)) Then
Begin
If OszlopMode Then
Begin
Kezd := Kezdodo;
Vege := Vegzodo;
End
Else
Begin
Kezd := 0;
Vege := c77;
If InInt(Cikl,Fpoz,Lpoz2) Then Kezd := Kezdodo;
If InInt(Cikl,Fpoz2,Lpoz) Then Vege := Vegzodo;
End;
If Vege < Kezd Then
Xchg(Kezd,Vege);
Heap_Pos(Source,PointerTomb^[Cikl]);
For X := Kezd To Vege Do
Begin
C := Source^.Chars[C80+X];
Att := Source^.Attribs[X] AND 15;
If MagyarE(Att) Then
EkSzer_To_ASCIIC(C);
{
Case C Of
'0' : C := '';
'!' : C := '0';
'#' : C := '+';
'/' : C := '-';
End;
}
VegeVan := (X = Vege);
If C In ['0'..'9','.',',','E','e','-','%'] Then
Ws := Ws + C
Else VegeVan := True;
If VegeVan AND (Ws <> '') Then
Begin
Oszto := 1;
If Ws[Length(Ws)] = '%' Then
Begin
Oszto := 100;
Dec(Byte(Ws[0]));
End;
While Pos(',',Ws) > 0 Do Delete(Ws,Pos(',',Ws),1);
If Ws[Length(Ws)] = '-' Then Dec(Byte(Ws[0]));
If (Ws <> '') AND (Ws[Pos('-',Ws)+1] In ['0'..'9']) Then
Begin
Val(Ws,Num,Code);
If Code = 0 Then
Begin
Num := Num / Oszto;
GlobalNum := GlobalNum + Num;
End
Else
Begin
Beepel(555);
End;
End;
Ws := '';
End;
End;
FreeEms1(PointerTomb^[Cikl]);
End;
End;
If GlobalNum <> 0 Then
Begin
If NOT Gyujtes Then CalcRes := CalcNum;
Case Par Of
Add : CalcRes := CalcRes + GlobalNum;
Sub : CalcRes := CalcRes - GlobalNum;
Multiply: CalcRes := CalcRes * GlobalNum;
Division: CalcRes := CalcRes / GlobalNum;
Equal : CalcRes := GlobalNum;
End;
CreateCalcResult(CalcRes);
End;
ClearImageBlock;
End; { Calculate_Block }
Procedure GIBBlock(Par : Byte);
Var
MarVolt : Boolean;
Cikl,Temp : Integer;
Veg,Kez : Byte;
NewMain : Integer;