Protected NOT protected?
Posted: Sat Jun 18, 2011 6:53 am
Tailbite 1.4.7 with PB 4.51.
Tailbite First.pb and Second.pb. Then run Third.pb. Seems that the protected variable alpha$ gets shared.
First.pb
Second.pb
Third.pb
Tailbite First.pb and Second.pb. Then run Third.pb. Seems that the protected variable alpha$ gets shared.
First.pb
Code: Select all
Procedure$ First_Private(p1$)
Protected alpha$ = ""
alpha$ = p1$ + " first"
ProcedureReturn alpha$
EndProcedure
ProcedureDLL$ First(p1$)
ProcedureReturn First_Private(p1$)
EndProcedure
Code: Select all
Procedure$ Seconds_Private(p1$)
Protected alpha$ = ""
alpha$ = p1$ + " second"
ProcedureReturn alpha$
EndProcedure
ProcedureDLL$ Seconds(p1$)
ProcedureReturn Seconds_Private(p1$)
EndProcedure
Code: Select all
Debug First(Seconds("*")) ; * second* second first
Procedure$ InFirst(p1$)
Protected alpha$ = ""
alpha$ = p1$ + " first"
ProcedureReturn alpha$
EndProcedure
Procedure$ InSeconds(p1$)
Protected alpha$ = ""
alpha$ = p1$ + " second"
ProcedureReturn alpha$
EndProcedure
Debug InFirst(InSeconds("*")) ; * second first