Scope of Variables in PropBasic
FriedV
Posts: 77
Hi,
is it right that Cog Vars are always global, whether defined in SUB or in the main program?
Is this true for Tasks also?
So if a want to use the same subroutine in the main program and in a task do i need to give them different names, and different names for the variables also?
Thx, Fried
is it right that Cog Vars are always global, whether defined in SUB or in the main program?
Is this true for Tasks also?
So if a want to use the same subroutine in the main program and in a task do i need to give them different names, and different names for the variables also?
Thx, Fried
Comments
VARs and SUBs are global to the task. Other tasks can use the same name.
If a different task needs the same SUB, you need to have it twice. This is a waste for LMM, but it's tricky to try to share SUBs.
Bean