I'm trying to make a number that increases by a different amount every time (increment), but the value of that number is not random. It follows an equation which has only 1 dynamic integer, being the "everincreasing" one. But I've run into a snag as I'm trying to make my WFA do this in a public int. And it's giving me an error on my everincreasing in the formula.
This number is to be used as an incremental number to add on everytime it runs. And everytime it runs, it adds 1 to the everincreasing.
public partial class Form1 : Form
{
public int everincreasing = 1;
public int increment = Convert.ToInt32(Math.Floor(everincreasing + 300 * Math.Pow(2, everincreasing / 7)));
}
When I hover over everincreasing the error tooltip says: A field initializer cannot reference the non-static field, method, or property 'Form1.everincreasing'
I looked for this exception on the msdocs for c# and I was unable to find how to fix it, so I'm here asking the question I couldn't figure out how to fix in msdocs.