In this small test app there are two forms. The first from creates an instance of the second form then opens it:
Private Sub Command1_Click()
Dim f as New Form2
f.show
End Sub
The second form (Form2) has the following code:
Private m_Regionid As Integer
______________________
Property Get Regionid()
If m_Regionid = 0 Then
m_Regionid = 999
End If
Regionid = m_Regionid
End Property
________________________
Private Sub Command1_Click()
Dim x as integer
x = Regionid
m_Regionid = Regionid + 1
End Sub
What puzzels me is that when I step through the code the private m_RegionID variable and the RegionID property already contain the value 999 even before the Property has been called from the Sub routine. (This can be seen by hovering the cursor over the said variables).My interest is purely academic but would still like to know.
thanks in advance
Yael
Private Sub Command1_Click()
Dim f as New Form2
f.show
End Sub
The second form (Form2) has the following code:
Private m_Regionid As Integer
______________________
Property Get Regionid()
If m_Regionid = 0 Then
m_Regionid = 999
End If
Regionid = m_Regionid
End Property
________________________
Private Sub Command1_Click()
Dim x as integer
x = Regionid
m_Regionid = Regionid + 1
End Sub
What puzzels me is that when I step through the code the private m_RegionID variable and the RegionID property already contain the value 999 even before the Property has been called from the Sub routine. (This can be seen by hovering the cursor over the said variables).My interest is purely academic but would still like to know.
thanks in advance
Yael