Subversion Repositories oidplus

Rev

Rev 758 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 758 Rev 992
Line 1... Line 1...
1
unit VTSCUI;
1
unit VTSCUI;
2
 
2
 
3
(************************************************)
3
(************************************************)
4
(* VTSCUI.PAS                                   *)
4
(* VTSCUI.PAS                                   *)
5
(* Author:   Daniel Marschall                   *)
5
(* Author:   Daniel Marschall                   *)
6
(* Revision: 2022-02-27                         *)
6
(* Revision: 2022-10-10                         *)
7
(* License:  Apache 2.0                         *)
7
(* License:  Apache 2.0                         *)
8
(* This file contains:                          *)
8
(* This file contains:                          *)
9
(* - ViaThinkSoft CUI (Console User Interface)  *)
9
(* - ViaThinkSoft CUI (Console User Interface)  *)
10
(************************************************)
10
(************************************************)
11
 
11
 
Line 65... Line 65...
65
  i: integer;
65
  i: integer;
66
begin
66
begin
67
  s := str;
67
  s := str;
68
  for i := Length(str) to len-1 do
68
  for i := Length(str) to len-1 do
69
  begin
69
  begin
-
 
70
    if Length(s) >= 255 then break;
70
    s := s + c;
71
    s := s + c;
71
  end;
72
  end;
72
  FillRight := s;
73
  FillRight := s;
73
end;
74
end;
74
 
75
 
Line 456... Line 457...
456
  s := '';
457
  s := '';
457
  for i := 1 to Length(stmp) do
458
  for i := 1 to Length(stmp) do
458
  begin
459
  begin
459
    if stmp[i] = #10 then
460
    if stmp[i] = #10 then
460
    begin
461
    begin
-
 
462
      if Length(s) >= 255 then
-
 
463
      begin
-
 
464
        Beep;
-
 
465
        continue;
-
 
466
      end;
461
      s := s + stmp[i];
467
      s := s + stmp[i];
462
      continue;
468
      continue;
463
    end;
469
    end;
464
 
470
 
465
    GoToXY(x,y);
471
    GoToXY(x,y);
-
 
472
    if Length(s) >= 255 then
-
 
473
    begin
-
 
474
      Beep;
-
 
475
      continue;
-
 
476
    end;
466
    s := s + stmp[i];
477
    s := s + stmp[i];
467
    Write(stmp[i]);
478
    Write(stmp[i]);
468
    Inc(x);
479
    Inc(x);
469
 
480
 
470
    if (x=initX+width-1) and (y=initY+height-1) then
481
    if (x=initX+width-1) and (y=initY+height-1) then
Line 545... Line 556...
545
        if y=initY+height-1 then
556
        if y=initY+height-1 then
546
        begin
557
        begin
547
          Beep;
558
          Beep;
548
          continue;
559
          continue;
549
        end;
560
        end;
-
 
561
        if Length(s) >= 254 then
-
 
562
        begin
-
 
563
          Beep;
-
 
564
          continue;
-
 
565
        end;
550
        s := s + #13 + #10;
566
        s := s + #13 + #10;
551
        x := initX;
567
        x := initX;
552
        Inc(y);
568
        Inc(y);
553
      end
569
      end
554
      else
570
      else
Line 567... Line 583...
567
      if (x=initX+width-1) and (y=initY+height-1) then
583
      if (x=initX+width-1) and (y=initY+height-1) then
568
      begin
584
      begin
569
        Beep;
585
        Beep;
570
        continue;
586
        continue;
571
      end;
587
      end;
-
 
588
      if Length(s) >= 255-Length(sc)+1 then
-
 
589
      begin
-
 
590
        Beep;
-
 
591
        continue;
-
 
592
      end;
572
      s := s + sc;
593
      s := s + sc;
573
      Write(sc);
594
      Write(sc);
574
      Inc(x);
595
      Inc(x);
575
      if x >= initX+width then
596
      if x >= initX+width then
576
      begin
597
      begin