chikega
(Gary Chike)
November 28, 2021, 11:25pm
1
… slashing all the boiler template code
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//namespace Cons_CS_NetCore
//{
//static class Program
//{
//public static Int32 Main(string[] args)
//{
//Console.WriteLine("The magic happens here.");
//return 0;
//}
//}
//}
Console.WriteLine("Hello World!");
1 Like
mh
(marc hoffman)
November 29, 2021, 2:53pm
2
Should work for all platforms, FWIW (older/Classic .NET, as well as non-.NET), as well.
2 Likes
Theo69
(Theo)
November 30, 2021, 1:26pm
3
Is it difficult to add that to the other languages?
mh
(marc hoffman)
November 30, 2021, 1:28pm
4
Should be easy. Swift always supported this, and Oxygene has begin
/end.
so doesn’t really need this. But adding it to Mercury should be simple; i’ll log.
1 Like
Could begin end be extended to support a task ?
begin
await Task.Delay(TimeSpan.FromSeconds(2));
end.
With this I get await is not supported here.
bugs://E25541 was closed as fixed.
It builds but doesn’t seem to wait
ClassLessApplication.zip (130.7 KB)
I just see ‘start’ on the console.
These are the same arent they ?
namespace ClassLessApplication;
interface
uses
System.Diagnostics;
implementation
begin
Console.WriteLine('Start');
var sw := Stopwatch.StartNew;
await Task.Delay(TimeSpan.FromSeconds(2));
sw.Stop;
Console.WriteLine(sw.ElapsedMilliseconds);
Console.WriteLine('Stop');
end.```
c#
using System.Diagnostics;
var sw = Stopwatch.StartNew();
await Task.Delay(TimeSpan.FromSeconds(2));
sw.Stop();
Console.WriteLine(sw.ElapsedMilliseconds);
bugs://E25540 was closed as fixed.
bugs://E25541 was reopened.
bugs://E25541 was closed as fixed.
ck
(Carlo Kok)
December 1, 2021, 12:23pm
13
My apologies I overlooked 1 change that caused this. Properly fixed now.
4 Likes
chikega
(Gary Chike)
March 18, 2022, 3:16am
14
You’re right, the shortest Oxygene program I’ve written yet! Works in both .Net 6.0 and Classic .Net
namespace NetCoreTestOxy;
begin
writeLn('The magic happens here.');
end.
1 Like