This is by design. HG c# programs are just straight c# coding with no class definition.
To define a subrouting you can do like this:
var SomeThing = new Action(()=>{
Program.Notify("Test", "Hello World!");
});
SomeThing();
or in case you need a return value
var GetHalf = new Func<double, double>((number)=>{
return number / 2d;
});
Program.Notify("Test", "Half of 5 is " + GetHalf(5));
Cheers,
g.