Ignore:
Timestamp:
Oct 29, 2009, 11:07:49 AM (15 years ago)
Author:
george
Message:
  • Přidáno: Deklarace proměnných a volání procedur.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Syntetizer/UMainForm.pas

    r26 r27  
    4747    with TProgram(BaseElement) do begin
    4848      Name := 'Test';
     49      with TCompilerDirective(CompilerDirectives[CompilerDirectives.Add(TCompilerDirective.Create)]) do begin
     50        Variable := 'APPTYPE';
     51        Value := 'CONSOLE';
     52      end;
     53      with Variables do begin
     54        with TVariableDeclaration(Variables[Variables.Add(TVariableDeclaration.Create)]) do begin
     55          Name := 'Text';
     56          VarType := 'string';
     57        end;
     58      end;
     59      with Code do begin
     60        with TProcedureCall(Commands[Commands.Add(TProcedureCall.Create)]) do begin
     61          Name := 'WriteLn';
     62          with TProcedureParameter(Parameters[Parameters.Add(TProcedureParameter.Create)]) do begin
     63            Value := '''Hello hell''';
     64          end;
     65        end;
     66        with TProcedureCall(Commands[Commands.Add(TProcedureCall.Create)]) do begin
     67          Name := 'ReadLn';
     68        end;
     69      end;
    4970    end;
    5071    Syntetize;
    5172    Memo1.Lines.Assign(Output);
    52     Output.SaveToFile('Output.pas');
     73    Output.SaveToFile('Output.dpr');
    5374  end;
    5475end;
Note: See TracChangeset for help on using the changeset viewer.