Ignore:
Timestamp:
Jun 26, 2023, 6:08:23 PM (17 months ago)
Author:
chronos
Message:
  • Added: Support for procedures.
  • Added: Project pascal file can be opened from main menu. Last file name is remembered.
  • Modified: Improved XML output of source structure.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/xpascal/Generators/GeneratorCSharp.pas

    r230 r233  
    227227
    228228procedure TGeneratorCSharp.GenerateProgram(Block: TBlock; Prog: TProgram);
    229 begin
     229var
     230  MainClass: string;
     231begin
     232  if Prog.Name <> '' then MainClass := Prog.Name
     233    else MainClass := 'App';
    230234  AddTextLine('using System;');
    231235  AddTextLine;
    232   AddTextLine('public class ' + Prog.Name);
     236  AddTextLine('public class ' + MainClass);
    233237  AddTextLine('{');
    234238  Indent := Indent + 1;
     
    237241  AddTextLine('public static void Main()');
    238242  AddTextLine('{');
    239   AddTextLine('  ' + Prog.Name + ' app = new ' + Prog.Name + '();');
     243  AddTextLine('  ' + MainClass + ' app = new ' + MainClass + '();');
    240244  AddTextLine('  app.Entry();');
    241245  AddTextLine('}');
Note: See TracChangeset for help on using the changeset viewer.