Page 1 of 1

Problem wihen using void methods inside methods :D

Posted: Fri Jul 14, 2017 5:29 pm
by jamisco
Why do i get an error when i compile code when i do some thing like this? Normally this should work, atleast it works in visual studio.

Code: Select all


        public void OnStartup()
        {
	     void Life()
            {
                 Game.ShowPopupMessage("life");
            }
	   Life();
        }
I get this error code
picture of error message

Whats causing the problem and how do i fix it

Thanks!! :D

Re: Problem wihen using void methods inside methods :D

Posted: Fri Jul 14, 2017 6:49 pm
by Gurt
Local functions are only supported in C#7. You're limited to features in C#4 (or maybe C#5 - I don't remember exactly) in SFD.