Static Statement [Runtime]/text/sbasic/shared/03103500.xhpSun Microsystems, Inc.converted from old format - fpeStatic statementStatic Statement [Runtime]Declares a variable or an array at the procedure level within a subroutine or a function, so that the values of the variable or the array are retained after exiting the subroutine or function. Dim statement conventions are also valid.The Static statement cannot be used to define variable arrays. Arrays must be specified according to a fixed size.Syntax:Static VarName[(start To end)] [As VarType], VarName2[(start To end)] [As VarType], ...Example:Sub ExampleStaticDim iCount as Integer, iResult as IntegerFor iCount = 0 to 2iResult = InitVar()Next iCountMsgBox iResult,0,"The answer is"End SubREM Function for initialization of the static variableFunction InitVar() As IntegerStatic iInit As IntegerConst iMinimum as Integer = 40 REM minimum return value of this functionif iInit = 0 then REM check if initializediInit = iMinimumelseiInit = iInit + 1end ifInitVar = iInitEnd Function