LibreOffice 7.5 Help
λ³μλ λ°°μ΄μ κ°μ΄ μλΈλ£¨ν΄ λλ ν¨μκ° μ’ λ£λ νμλ μ μ§λλλ‘ λ³μλ λ°°μ΄μ μλΈλ£¨ν΄ λλ ν¨μ λ΄μ νλ‘μμ μμ€μμ μ μΈν©λλ€. λν Dim λ¬Έ κ·μΉλ μ ν¨ν©λλ€.
Static λ¬Έμ λ³μ λ°°μ΄μ μ§μ νλ λ° μ¬μ©ν μ μμ΅λλ€. λ°°μ΄μ κ³ μ ν¬κΈ°λ‘ μ§μ ν΄μΌ ν©λλ€.
Static VarName[(start To end)] [As VarType], VarName2[(start To end)] [As VarType], ...
Sub ExampleStatic
Dim iCount As Integer, iResult As Integer
For iCount = 0 To 2
iResult = InitVar()
Next iCount
MsgBox iResult,0,"The answer is"
End Sub
REM Function for initialization of the static variable
Function InitVar() As Integer
Static iInit As Integer
Const iMinimum as Integer = 40 REM minimum return value of this function
if iInit = 0 then REM check if initialized
iInit = iMinimum
Else
iInit = iInit + 1
End If
InitVar = iInit
End Function