Changeset 233 for branches/xpascal/Generators/GeneratorCSharp.pas
- Timestamp:
- Jun 26, 2023, 6:08:23 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xpascal/Generators/GeneratorCSharp.pas
r230 r233 227 227 228 228 procedure TGeneratorCSharp.GenerateProgram(Block: TBlock; Prog: TProgram); 229 begin 229 var 230 MainClass: string; 231 begin 232 if Prog.Name <> '' then MainClass := Prog.Name 233 else MainClass := 'App'; 230 234 AddTextLine('using System;'); 231 235 AddTextLine; 232 AddTextLine('public class ' + Prog.Name);236 AddTextLine('public class ' + MainClass); 233 237 AddTextLine('{'); 234 238 Indent := Indent + 1; … … 237 241 AddTextLine('public static void Main()'); 238 242 AddTextLine('{'); 239 AddTextLine(' ' + Prog.Name + ' app = new ' + Prog.Name+ '();');243 AddTextLine(' ' + MainClass + ' app = new ' + MainClass + '();'); 240 244 AddTextLine(' app.Entry();'); 241 245 AddTextLine('}');
Note:
See TracChangeset
for help on using the changeset viewer.