static local variables

Is there a correct way to define a variable inside a function as “static” so it retains a value between invocations of the function? I’ve resorted to a user code block in order to do it so far. Unfortunately, that doesn’t make the variable “known” to the rest of the EasyC system – it won’t show up in the drop-down menus, for example.

You can use a user code block and it must be in the first line of the function. Like you mentioned, shown below but you are correct it will not make the variable known. We had this in easyC for FRC 2 years ago and it caused allot of problems with users mis-using it.

static.JPG


static.JPG