Changeset 91 for trunk/Forms


Ignore:
Timestamp:
Jul 20, 2018, 9:41:37 AM (6 years ago)
Author:
chronos
Message:
  • Added: Allow to enable individual code optimization from settings dialog.
  • Added: Actions to format or shrink target BF code.
Location:
trunk/Forms
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms

    • Property svn:ignore set to
      *.lrj
  • trunk/Forms/UFormMain.lfm

    r88 r91  
    11object FormMain: TFormMain
    2   Left = 490
     2  Left = 405
    33  Height = 586
    4   Top = 315
     4  Top = 226
    55  Width = 860
    66  Caption = 'LazFuck'
    7   ClientHeight = 554
     7  ClientHeight = 561
    88  ClientWidth = 860
     9  DesignTimePPI = 120
    910  Menu = MainMenu1
    1011  OnClose = FormClose
     
    1314  OnDestroy = FormDestroy
    1415  OnShow = FormShow
    15   LCLVersion = '1.6.4.0'
     16  LCLVersion = '1.8.2.0'
    1617  WindowState = wsMaximized
    1718  object StatusBarMain: TStatusBar
    1819    Left = 0
    1920    Height = 28
    20     Top = 526
     21    Top = 533
    2122    Width = 860
    2223    Panels = <   
     
    4748    end
    4849    object ToolButton2: TToolButton
    49       Left = 24
     50      Left = 30
    5051      Top = 2
    5152      Action = AProjectOpen
     
    5455    end
    5556    object ToolButton3: TToolButton
    56       Left = 59
     57      Left = 74
    5758      Top = 2
    5859      Action = AProjectSave
    5960    end
    6061    object ToolButton4: TToolButton
    61       Left = 82
     62      Left = 103
    6263      Top = 2
    6364      Action = AProjectClose
    6465    end
    6566    object ToolButton5: TToolButton
    66       Left = 128
    67       Height = 22
    68       Top = 2
    69       Width = 10
     67      Left = 161
     68      Height = 28
     69      Top = 2
    7070      Style = tbsSeparator
    7171    end
    7272    object ToolButton6: TToolButton
    73       Left = 161
     73      Left = 198
    7474      Top = 2
    7575      Action = AProgramRun
    7676    end
    7777    object ToolButton7: TToolButton
    78       Left = 138
     78      Left = 169
    7979      Top = 2
    8080      Action = AProgramCompile
    8181    end
    8282    object ToolButton8: TToolButton
    83       Left = 105
     83      Left = 132
    8484      Top = 2
    8585      Action = AOptions
    8686    end
    8787    object ToolButton9: TToolButton
    88       Left = 230
     88      Left = 285
    8989      Top = 2
    9090      Action = ABreakpointToggle
    9191    end
    9292    object ToolButton10: TToolButton
    93       Left = 184
     93      Left = 227
    9494      Top = 2
    9595      Action = AProgramPause
    9696    end
    9797    object ToolButton11: TToolButton
    98       Left = 207
     98      Left = 256
    9999      Top = 2
    100100      Action = AProgramStop
    101101    end
    102102    object ToolButton12: TToolButton
    103       Left = 253
     103      Left = 314
    104104      Top = 2
    105105      Action = AProgramStepOver
    106106    end
    107107    object ToolButton13: TToolButton
    108       Left = 276
     108      Left = 343
    109109      Top = 2
    110110      Action = AProgramStepInto
    111111    end
    112112    object ToolButton14: TToolButton
    113       Left = 299
     113      Left = 372
    114114      Top = 2
    115115      Action = AProgramStepOut
    116116    end
    117117    object ToolButton15: TToolButton
    118       Left = 322
     118      Left = 401
    119119      Top = 2
    120120      Action = AProgramRunToCursor
    121121    end
    122122    object ToolButtonTarget: TToolButton
    123       Left = 345
     123      Left = 430
    124124      Hint = 'Target select'
    125125      Top = 2
     
    131131  object PageControlRight: TPageControl
    132132    Left = 467
    133     Height = 500
     133    Height = 507
    134134    Top = 26
    135135    Width = 393
     
    141141    object TabSheetDebug: TTabSheet
    142142      Caption = 'Debug'
    143       ClientHeight = 494
    144       ClientWidth = 319
     143      ClientHeight = 499
     144      ClientWidth = 359
    145145      object PanelInput: TPanel
    146146        Left = 0
    147147        Height = 64
    148148        Top = 0
    149         Width = 319
     149        Width = 359
    150150        Align = alTop
    151151        BevelOuter = bvNone
     
    157157        Height = 5
    158158        Top = 64
    159         Width = 319
     159        Width = 359
    160160        Align = alTop
    161161        ResizeAnchor = akTop
     
    165165        Height = 259
    166166        Top = 69
    167         Width = 319
     167        Width = 359
    168168        Align = alTop
    169169        BevelOuter = bvNone
     
    175175        Height = 5
    176176        Top = 328
    177         Width = 319
     177        Width = 359
    178178        Align = alTop
    179179        ResizeAnchor = akTop
     
    183183        Height = 86
    184184        Top = 333
    185         Width = 319
     185        Width = 359
    186186        Align = alTop
    187187        BevelOuter = bvNone
     
    193193        Height = 5
    194194        Top = 419
    195         Width = 319
     195        Width = 359
    196196        Align = alTop
    197197        ResizeAnchor = akTop
     
    199199      object PanelMemory: TPanel
    200200        Left = 0
    201         Height = 70
     201        Height = 75
    202202        Top = 424
    203         Width = 319
     203        Width = 359
    204204        Align = alClient
    205205        BevelOuter = bvNone
     
    210210  object Splitter1: TSplitter
    211211    Left = 462
    212     Height = 500
     212    Height = 507
    213213    Top = 26
    214214    Width = 5
     
    218218  object PanelLeft: TPanel
    219219    Left = 0
    220     Height = 500
     220    Height = 507
    221221    Top = 26
    222222    Width = 462
    223223    Align = alClient
    224224    BevelOuter = bvNone
    225     ClientHeight = 500
     225    ClientHeight = 507
    226226    ClientWidth = 462
    227227    TabOrder = 4
    228228    object PageControlMain: TPageControl
    229229      Left = 0
    230       Height = 377
     230      Height = 384
    231231      Top = 0
    232232      Width = 462
     
    246246      Left = 0
    247247      Height = 118
    248       Top = 382
     248      Top = 389
    249249      Width = 462
    250250      ActivePage = TabSheetMessages
     
    261261      Left = 0
    262262      Height = 5
    263       Top = 377
     263      Top = 384
    264264      Width = 462
    265265      Align = alBottom
  • trunk/Forms/UFormMain.pas

    r90 r91  
    77uses
    88  Classes, SysUtils, FileUtil, SynEdit, Forms, Controls, Graphics, Dialogs,
    9   Menus, ActnList, ComCtrls, ExtCtrls, UTarget, Registry, URegistry, Process,
     9  Menus, ActnList, ComCtrls, ExtCtrls, UTarget, Registry, URegistry,
    1010  LazFileUtils;
    1111
     
    305305    if not Assigned(Core.CurrentTarget) then
    306306      Core.CurrentTarget := TTarget(Core.Targets[0]);
     307    Core.Optimizations.AddSub := ReadBoolWithDefault('OptimizationAddSubEnabled', True);
     308    Core.Optimizations.Merge := ReadBoolWithDefault('OptimizationMerge', True);
     309    Core.Optimizations.CopyMultiply := ReadBoolWithDefault('OptimizationCopyMultiplyEnabled', True);
     310    Core.Optimizations.RelativeIndexes := ReadBoolWithDefault('OptimizationRelativeIndexesEnabled', True);
    307311  finally
    308312    Free;
     
    317321    OpenKey(Key, True);
    318322    WriteString('TargetName', Core.CurrentTarget.Name);
     323    WriteBool('OptimizationAddSubEnabled', Core.Optimizations.AddSub);
     324    WriteBool('OptimizationMerge', Core.Optimizations.Merge);
     325    WriteBool('OptimizationCopyMultiplyEnabled', Core.Optimizations.CopyMultiply);
     326    WriteBool('OptimizationRelativeIndexesEnabled', Core.Optimizations.RelativeIndexes);
    319327  finally
    320328    Free;
     
    458466procedure TFormMain.AOptionsExecute(Sender: TObject);
    459467begin
    460   OptionsForm.Load;
    461   if OptionsForm.ShowModal = mrOK then begin
    462     OptionsForm.Save;
    463     if Assigned(Core.CurrentTarget) then begin
    464       Core.CurrentTarget.OptimizationLevel := Core.OptimizationLevel;
    465       if Core.CurrentTarget is TBFTarget then begin
    466         TBFTarget(Core.CurrentTarget).CellSize := Core.CellSize;
    467         TBFTarget(Core.CurrentTarget).MemorySize := Core.MemorySize;
     468  FormOptions := TFormOptions.Create(nil);
     469  try
     470    FormOptions.Load;
     471    if FormOptions.ShowModal = mrOK then begin
     472      FormOptions.Save;
     473      if Assigned(Core.CurrentTarget) then begin
     474        Core.CurrentTarget.OptimizationLevel := Core.OptimizationLevel;
     475        if Core.CurrentTarget is TBFTarget then begin
     476          TBFTarget(Core.CurrentTarget).CellSize := Core.CellSize;
     477          TBFTarget(Core.CurrentTarget).MemorySize := Core.MemorySize;
     478        end;
    468479      end;
    469480    end;
     481  finally
     482    FormOptions.Free;
    470483  end;
    471484end;
     
    479492    ProjectFileName := Core.Project.FileName;
    480493    ProgramName := ExtractFileNameOnly(Core.Project.FileName);
     494    if Core.CurrentTarget is TBFTarget then
     495      TBFTarget(Core.CurrentTarget).Optimizations := Core.Optimizations;
    481496    Core.CurrentTarget.Messages.AddMessage(SCompileStart);
    482497    Application.ProcessMessages;
  • trunk/Forms/UFormOptions.lfm

    r70 r91  
    1 object OptionsForm: TOptionsForm
    2   Left = 665
    3   Height = 339
    4   Top = 370
    5   Width = 468
     1object FormOptions: TFormOptions
     2  Left = 510
     3  Height = 418
     4  Top = 324
     5  Width = 511
    66  Caption = 'Options'
    7   ClientHeight = 339
    8   ClientWidth = 468
     7  ClientHeight = 418
     8  ClientWidth = 511
     9  DesignTimePPI = 120
     10  OnClose = FormClose
     11  OnCreate = FormCreate
    912  OnShow = FormShow
    10   LCLVersion = '1.5'
     13  LCLVersion = '1.8.2.0'
    1114  object ButtonOk: TButton
    12     Left = 389
     15    Left = 422
    1316    Height = 25
    14     Top = 307
     17    Top = 386
    1518    Width = 75
    1619    Anchors = [akRight, akBottom]
     
    2124  end
    2225  object ButtonCancel: TButton
    23     Left = 304
     26    Left = 334
    2427    Height = 25
    25     Top = 307
     28    Top = 386
    2629    Width = 75
    2730    Anchors = [akRight, akBottom]
     
    3235  object SpinEditCellSize: TSpinEdit
    3336    Left = 165
    34     Height = 35
     37    Height = 28
    3538    Top = 40
    3639    Width = 130
     
    4043  object SpinEditMemorySize: TSpinEdit
    4144    Left = 165
    42     Height = 35
     45    Height = 28
    4346    Top = 6
    4447    Width = 130
     
    4851  object Label1: TLabel
    4952    Left = 8
    50     Height = 25
     53    Height = 20
    5154    Top = 8
    52     Width = 123
     55    Width = 87
    5356    Caption = 'Memory size:'
    5457    ParentColor = False
     
    5659  object Label2: TLabel
    5760    Left = 8
    58     Height = 25
     61    Height = 20
    5962    Top = 40
    60     Width = 79
     63    Width = 57
    6164    Caption = 'Cell size:'
    6265    ParentColor = False
     
    6467  object Label3: TLabel
    6568    Left = 8
    66     Height = 25
     69    Height = 20
    6770    Top = 95
    68     Width = 179
     71    Width = 127
    6972    Caption = 'Interface language:'
    7073    ParentColor = False
     
    7477    Height = 27
    7578    Top = 128
    76     Width = 456
     79    Width = 499
    7780    Anchors = [akTop, akLeft, akRight]
    7881    AutoSize = False
     
    8285  object SpinEditDPIX: TSpinEdit
    8386    Left = 104
    84     Height = 35
     87    Height = 28
    8588    Top = 193
    8689    Width = 80
     
    9295  object LabelDPI: TLabel
    9396    Left = 24
    94     Height = 25
     97    Height = 20
    9598    Top = 201
    96     Width = 39
     99    Width = 26
    97100    Caption = 'DPI:'
    98101    ParentColor = False
     
    100103  object SpinEditDPIY: TSpinEdit
    101104    Left = 208
    102     Height = 35
     105    Height = 28
    103106    Top = 193
    104107    Width = 80
     
    110113  object LabelX: TLabel
    111114    Left = 192
    112     Height = 25
     115    Height = 20
    113116    Top = 201
    114     Width = 10
     117    Width = 7
    115118    Caption = 'x'
    116119    ParentColor = False
     
    120123    Height = 27
    121124    Top = 168
    122     Width = 448
     125    Width = 491
    123126    Anchors = [akTop, akLeft, akRight]
    124127    AutoSize = False
     
    129132  object Label4: TLabel
    130133    Left = 16
    131     Height = 25
     134    Height = 20
    132135    Top = 248
    133     Width = 221
     136    Width = 159
    134137    Caption = 'Compiler optimizations:'
    135138    ParentColor = False
     
    137140  object ComboBoxLanguage: TComboBox
    138141    Left = 248
    139     Height = 37
     142    Height = 28
    140143    Top = 83
    141144    Width = 188
    142     ItemHeight = 0
     145    ItemHeight = 20
    143146    Style = csDropDownList
    144147    TabOrder = 8
    145148  end
    146   object ComboBoxOptimizatipn: TComboBox
     149  object CheckBoxOptimizeAddSub: TCheckBox
     150    Left = 39
     151    Height = 24
     152    Top = 280
     153    Width = 189
     154    Caption = 'Addition and subtraction'
     155    TabOrder = 9
     156  end
     157  object CheckBoxOptimizeMerge: TCheckBox
     158    Left = 39
     159    Height = 24
     160    Top = 304
     161    Width = 181
     162    Caption = 'Merge same operations'
     163    TabOrder = 10
     164  end
     165  object CheckBoxOptimizeRelativeIndexes: TCheckBox
     166    Left = 39
     167    Height = 24
     168    Top = 328
     169    Width = 131
     170    Caption = 'Relative indexes'
     171    TabOrder = 11
     172  end
     173  object CheckBoxOptimizeCopyMultiply: TCheckBox
     174    Left = 39
     175    Height = 24
     176    Top = 352
     177    Width = 116
     178    Caption = 'Copy multiply'
     179    TabOrder = 12
     180  end
     181  object ComboBoxOptimization: TComboBox
    147182    Left = 256
    148     Height = 37
    149     Top = 240
     183    Height = 28
     184    Top = 248
    150185    Width = 188
    151     ItemHeight = 0
     186    ItemHeight = 20
    152187    Items.Strings = (
    153188      'None'
    154189      'Normal'
    155190    )
     191    OnSelect = CheckBoxDPIAutoChange
    156192    Style = csDropDownList
    157     TabOrder = 9
     193    TabOrder = 13
    158194  end
    159195end
  • trunk/Forms/UFormOptions.pas

    r88 r91  
    1111type
    1212
    13   { TOptionsForm }
     13  { TFormOptions }
    1414
    15   TOptionsForm = class(TForm)
     15  TFormOptions = class(TForm)
    1616    ButtonOk: TButton;
    1717    ButtonCancel: TButton;
    1818    CheckBox1: TCheckBox;
     19    CheckBoxOptimizeAddSub: TCheckBox;
    1920    CheckBoxDPIAuto: TCheckBox;
     21    CheckBoxOptimizeMerge: TCheckBox;
     22    CheckBoxOptimizeRelativeIndexes: TCheckBox;
     23    CheckBoxOptimizeCopyMultiply: TCheckBox;
    2024    ComboBoxLanguage: TComboBox;
    21     ComboBoxOptimizatipn: TComboBox;
     25    ComboBoxOptimization: TComboBox;
    2226    Label1: TLabel;
    2327    Label2: TLabel;
     
    3236    procedure ButtonOkClick(Sender: TObject);
    3337    procedure CheckBoxDPIAutoChange(Sender: TObject);
     38    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     39    procedure FormCreate(Sender: TObject);
    3440    procedure FormShow(Sender: TObject);
    3541  private
     
    4248
    4349var
    44   OptionsForm: TOptionsForm;
     50  FormOptions: TFormOptions;
    4551
    4652implementation
     
    5157  UCore, ULanguages;
    5258
    53 { TOptionsForm }
     59{ TFormOptions }
    5460
    55 procedure TOptionsForm.FormShow(Sender: TObject);
     61procedure TFormOptions.FormShow(Sender: TObject);
    5662begin
     63  Core.PersistentForm1.Load(Self);
     64
    5765  Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);
    5866  ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language);
     
    6169end;
    6270
    63 procedure TOptionsForm.UpdateInterface;
     71procedure TFormOptions.UpdateInterface;
    6472begin
    6573  SpinEditDPIX.Enabled := not CheckBoxDPIAuto.Checked;
     
    7179    SpinEditDPIY.Value := ScreenInfo.PixelsPerInchY;
    7280  end;
     81  CheckBoxOptimizeAddSub.Enabled := ComboBoxOptimization.ItemIndex > 0;
     82  CheckBoxOptimizeMerge.Enabled := ComboBoxOptimization.ItemIndex > 0;
     83  CheckBoxOptimizeRelativeIndexes.Enabled := ComboBoxOptimization.ItemIndex > 0;
     84  CheckBoxOptimizeCopyMultiply.Enabled := ComboBoxOptimization.ItemIndex > 0;
    7385end;
    7486
    75 procedure TOptionsForm.Load;
     87procedure TFormOptions.Load;
    7688begin
     89  CheckBoxOptimizeAddSub.Checked := Core.Optimizations.AddSub;
     90  CheckBoxOptimizeMerge.Checked := Core.Optimizations.Merge;
     91  CheckBoxOptimizeRelativeIndexes.Checked := Core.Optimizations.RelativeIndexes;
     92  CheckBoxOptimizeCopyMultiply.Checked := Core.Optimizations.CopyMultiply;
    7793  SpinEditDPIX.Value := Core.ScaleDPI1.DPI.X;
    7894  SpinEditDPIY.Value := Core.ScaleDPI1.DPI.Y;
    7995  CheckBoxDPIAuto.Checked := Core.ScaleDPI1.AutoDetect;
    80   ComboBoxOptimizatipn.ItemIndex := Integer(Core.OptimizationLevel);
     96  ComboBoxOptimization.ItemIndex := Integer(Core.OptimizationLevel);
    8197  SpinEditCellSize.Value := Core.CellSize;
    8298  SpinEditMemorySize.Value := Core.MemorySize;
     
    84100end;
    85101
    86 procedure TOptionsForm.Save;
     102procedure TFormOptions.Save;
    87103begin
    88104  Core.ScaleDPI1.DPI := Point(SpinEditDPIX.Value, SpinEditDPIY.Value);
    89105  Core.ScaleDPI1.AutoDetect := CheckBoxDPIAuto.Checked;
    90   Core.OptimizationLevel := TCompilerOptimization(ComboBoxOptimizatipn.ItemIndex);
     106  Core.OptimizationLevel := TCompilerOptimization(ComboBoxOptimization.ItemIndex);
    91107  Core.CellSize := SpinEditCellSize.Value;
    92108  Core.MemorySize := SpinEditMemorySize.Value;
     109  Core.Optimizations.AddSub := CheckBoxOptimizeAddSub.Checked;
     110  Core.Optimizations.Merge := CheckBoxOptimizeMerge.Checked;
     111  Core.Optimizations.RelativeIndexes := CheckBoxOptimizeRelativeIndexes.Checked;
     112  Core.Optimizations.CopyMultiply := CheckBoxOptimizeCopyMultiply.Checked;
    93113end;
    94114
    95 procedure TOptionsForm.ButtonOkClick(Sender: TObject);
     115procedure TFormOptions.ButtonOkClick(Sender: TObject);
    96116begin
    97117  if ComboBoxLanguage.ItemIndex <> -1 then
     
    100120end;
    101121
    102 procedure TOptionsForm.CheckBoxDPIAutoChange(Sender: TObject);
     122procedure TFormOptions.CheckBoxDPIAutoChange(Sender: TObject);
    103123begin
    104124  UpdateInterface;
    105125end;
    106126
     127procedure TFormOptions.FormClose(Sender: TObject; var CloseAction: TCloseAction
     128  );
     129begin
     130  Core.PersistentForm1.Save(Self);
     131end;
     132
     133procedure TFormOptions.FormCreate(Sender: TObject);
     134begin
     135  Core.CoolTranslator1.TranslateComponentRecursive(Self);
     136end;
     137
    107138end.
    108139
  • trunk/Forms/UFormTargetCode.lfm

    r64 r91  
    11object FormTargetCode: TFormTargetCode
    2   Left = 306
     2  Left = 682
    33  Height = 240
    4   Top = 75
     4  Top = 485
    55  Width = 320
    66  Caption = 'Target code'
    77  ClientHeight = 240
    88  ClientWidth = 320
    9   LCLVersion = '1.3'
     9  DesignTimePPI = 120
     10  LCLVersion = '1.8.2.0'
    1011  object MemoTarget: TMemo
    1112    Left = 0
     
    2223  end
    2324  object PopupMenuTarget: TPopupMenu
    24     Images = MainForm.ImageListMain
     25    Images = Core.ImageListMain
    2526    left = 84
    2627    top = 100
    2728    object MenuItem20: TMenuItem
    28       Action = MainForm.AShowSourcePosition
     29      Action = AFormatCode
     30    end
     31    object MenuItem1: TMenuItem
     32      Action = AShrinkCode
     33    end
     34  end
     35  object ActionList1: TActionList
     36    Images = Core.ImageListMain
     37    left = 199
     38    top = 39
     39    object AFormatCode: TAction
     40      Caption = 'Format code'
     41      OnExecute = AFormatCodeExecute
     42    end
     43    object AShrinkCode: TAction
     44      Caption = 'Shrink code'
     45      OnExecute = AShrinkCodeExecute
    2946    end
    3047  end
  • trunk/Forms/UFormTargetCode.pas

    r46 r91  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   Menus;
     9  Menus, ActnList, strutils;
    1010
    1111type
     
    1414
    1515  TFormTargetCode = class(TForm)
     16    AShrinkCode: TAction;
     17    AFormatCode: TAction;
     18    ActionList1: TActionList;
    1619    MemoTarget: TMemo;
     20    MenuItem1: TMenuItem;
    1721    MenuItem20: TMenuItem;
    1822    PopupMenuTarget: TPopupMenu;
     23    procedure AFormatCodeExecute(Sender: TObject);
     24    procedure AShrinkCodeExecute(Sender: TObject);
    1925  private
    2026    { private declarations }
     
    3036{$R *.lfm}
    3137
     38{ TFormTargetCode }
     39
     40procedure TFormTargetCode.AFormatCodeExecute(Sender: TObject);
     41var
     42  Source: string;
     43  NewSource: string;
     44  Indent: Integer;
     45  I: Integer;
     46const
     47  IndentText = '  ';
     48begin
     49  Source := MemoTarget.Text;
     50  NewSource := '';
     51  Indent := 0;
     52  for I := 1 to Length(Source) do begin
     53    if Source[I] = '[' then begin
     54      NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding ;
     55      Inc(Indent);
     56      NewSource := NewSource + DupeString(IndentText, Indent);
     57    end
     58    else if Source[I] = ']' then begin
     59      Dec(Indent);
     60      NewSource := NewSource + LineEnding + DupeString(IndentText, Indent) + Source[I] + LineEnding + DupeString(IndentText, Indent);
     61    end
     62    else if Ord(Source[I]) > $20 then
     63      NewSource := NewSource + Source[I];
     64  end;
     65  MemoTarget.Text := NewSource;
     66end;
     67
     68procedure TFormTargetCode.AShrinkCodeExecute(Sender: TObject);
     69var
     70  Source: string;
     71  Pos: Integer;
     72  I: Integer;
     73begin
     74  Source := MemoTarget.Text;
     75  Pos := 1;
     76  for I := 1 to Length(Source) do begin
     77    if Source[I] > ' ' then begin
     78      Source[Pos] := Source[I];
     79      Inc(Pos);
     80    end;
     81  end;
     82  SetLength(Source, Pos - 1);
     83  MemoTarget.Text := Source;
     84end;
     85
    3286end.
    3387
Note: See TracChangeset for help on using the changeset viewer.