Ignore:
Timestamp:
Feb 13, 2012, 7:28:45 AM (13 years ago)
Author:
chronos
Message:
  • Added: Tool for number generation using '+' symbol.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UMainForm.pas

    r23 r24  
    2121    AAbout: TAction;
    2222    ABreakpointToggle: TAction;
     23    AGenerateNumber: TAction;
    2324    AShrinkSource: TAction;
    2425    AFormatSource: TAction;
     
    6566    MenuItem26: TMenuItem;
    6667    MenuItem27: TMenuItem;
     68    MenuItem28: TMenuItem;
     69    MenuItem29: TMenuItem;
    6770    MenuItemOpenRecent: TMenuItem;
    6871    MenuItemTarget: TMenuItem;
     
    9598    procedure AExitExecute(Sender: TObject);
    9699    procedure AFormatSourceExecute(Sender: TObject);
     100    procedure AGenerateNumberExecute(Sender: TObject);
    97101    procedure AOptionsExecute(Sender: TObject);
    98102    procedure AProgramPauseExecute(Sender: TObject);
     
    152156  UCompilerDelphi, UCompilerPHP;
    153157
     158resourcestring
     159  SEnterNumber = 'Enter number';
     160  SNumberGeneration = 'Number generation';
     161
    154162{ TMainForm }
    155163
     
    316324procedure TMainForm.AProgramRunExecute(Sender: TObject);
    317325begin
     326  InterpreterForm.LastStepCounter := 0;
    318327  InterpreterForm.Show;
    319328  BrainFuckInterpreter.Input := InterpreterForm.MemoInput.Lines.Text;
     
    388397end;
    389398
     399procedure TMainForm.AGenerateNumberExecute(Sender: TObject);
     400var
     401  NumberText: string;
     402  Number: Integer;
     403  I: Integer;
     404begin
     405  NumberText := InputBox(SNumberGeneration, SEnterNumber, '1');
     406  if TryStrToInt(NumberText, Number) then begin
     407    NumberText := '';
     408    for I := 0 to Number - 1 do
     409      NumberText := NumberText + '+';
     410    MemoSource.Text := MemoSource.Text + NumberText;
     411  end;
     412end;
     413
    390414procedure TMainForm.AOptionsExecute(Sender: TObject);
    391415begin
     
    458482    MemoSource.Lines.SaveToFile(UTF8Decode(SaveDialog1.FileName));
    459483    ProjectFileName := SaveDialog1.FileName;
     484    LastOpenedList.Add(SaveDialog1.FileName);
    460485    Modified := False;
    461486    UpdateInterface;
Note: See TracChangeset for help on using the changeset viewer.