Pakema
16 years agoContributor
Bug with using public variable
I'm using TC 8.0 Ent, VBScript
I have 3 units
Content of Unit1:
'USEUNIT Unit2
'USEUNIT Unit3
Function f2
Dim a
res = f1(var1)
ShowMessage(var1)
End Function ' f2
Content of Unit2:
Function f1(ByRef tVar)
f1 = True
tVar = 10
End Function ' f1
Content of Unit3:
Public var1
In Result when I start execute f2 - var1 = Empty.
Why?
P.S. This example in attach
I have 3 units
Content of Unit1:
'USEUNIT Unit2
'USEUNIT Unit3
Function f2
Dim a
res = f1(var1)
ShowMessage(var1)
End Function ' f2
Content of Unit2:
Function f1(ByRef tVar)
f1 = True
tVar = 10
End Function ' f1
Content of Unit3:
Public var1
In Result when I start execute f2 - var1 = Empty.
Why?
P.S. This example in attach