Option Explicit Public Mx As
' Option Explicit Public Mx As Byte Private My As Integer Public Sub Mother1() 'Объявление статической переменной Static Count As Byte Count = Count + 1 Mx = Mx - 2: Fz = My + 2 Debug.Print "Mother: Статическая переменная Count =", Count 'Вызов процедуры Father другого модуля или заключительной - Finish If Fx < Mx Then Father1 Else Finish End Sub Public Sub Finish() 'Заключительная печать Debug.Print "Finish: Fx = ", Fx, "Fy =", Fy, "Fz =", Fz Debug.Print "Mx =", Mx, "My =", My, "Mz =", Mz 'Объявления разных типов и печать значений, полученных при объявлении Dim B As Byte, I As Integer, L As Long Dim Sng As Single, D As Double, C As Currency Dim SF As String * 7, SV As String, Dat As Date Dim O As Object, V Debug.Print "B =", B, "I=", I, "L=", L Debug.Print "Sng =", Sng, "D =", D; "C=", C Debug.Print "SF =", SF, "SV =", SV, "Dat=", Dat If O Is Nothing Then Debug.Print "Объект не определен" If V = Empty Then Debug.Print "Variant переменные не инициализированы" End Sub |
Пример 3.1. |
Закрыть окно |
'Option Explicit
Public Mx As Byte
Private My As Integer
Public Sub Mother1()
'Объявление статической переменной
Static Count As Byte
Count = Count + 1
Mx = Mx - 2: Fz = My + 2
Debug.Print "Mother: Статическая переменная Count =", Count
' Вызов процедуры Father другого модуля или заключительной - Finish
If Fx < Mx Then Father1 Else Finish
End Sub
Public Sub Finish()
'Заключительная печать
Debug.Print "Finish: Fx = ", Fx, "Fy =", Fy, "Fz =", Fz
Debug.Print "Mx =", Mx, "My =", My, "Mz =", Mz
'Объявления разных типов и печать значений, полученных при объявлении
Dim B As Byte, I As Integer, L As Long
Dim Sng As Single, D As Double, C As Currency
Dim SF As String * 7, SV As String, Dat As Date
Dim O As Object, V
Debug.Print "B =", B, "I=", I, "L=", L
Debug.Print "Sng =", Sng, "D =", D; "C=", C
Debug.Print "SF =", SF, "SV =", SV, "Dat=", Dat
If O Is Nothing Then Debug.Print "Объект не определен"
If V = Empty Then Debug.Print "Variant переменные не инициализированы"
End Sub