The local variables in a ``++Static++`` ``++Sub++`` or ``++Function++`` are preserved between calls (meaning that these variables have the same lifetime as the owning module of their procedure). Static procedures should be avoided because they are difficult to test, and can result in unexpected behavior.


== Noncompliant Code Example

----
Private Static Function Foo() As Single
  Dim val As Single   ' val retains its value between invocations

  val = val + 1
  Foo = val

End Function
----


== Compliant Solution

----
Private Function Foo() As Single
  Dim val As Single

  val = val + 1
  Foo = val

End Function
----

