Hello,
First of all my application is in B4J, so my starting point is a Main module.
Searching the forum, I read a lot about the Callsub methods, but it is still not clear when to use them, and when not to use them.
To understand it better, I have some questions:
-Question 1:
When you create an instance of a class in the Main module, is that class running in the same thread as the Main module?
-Question 2:
I have a public function in a Main module, that access a private variable in the Main module.
I have a class, that is created in the Main module. In the class is a timer configured.
On the event of that timer, the class is calling the public function that changes the private variable in the Main module.
The call is done without callsub, just a call of the function -> Main.ThePublicFunctionInMainModule
Is there a chance, due to an event in the Main module, and the event from the class, that there is a collision? (accessing the same variable from the class and the Main)
Or is this impossible?
-Question 3:
I suppose Callsub is an event that "synchronizes" with the thread/class where it is called? Is this correct?
Thanks in advance,
Kind regards,
Coldrestart.
First of all my application is in B4J, so my starting point is a Main module.
Searching the forum, I read a lot about the Callsub methods, but it is still not clear when to use them, and when not to use them.
To understand it better, I have some questions:
-Question 1:
When you create an instance of a class in the Main module, is that class running in the same thread as the Main module?
-Question 2:
I have a public function in a Main module, that access a private variable in the Main module.
I have a class, that is created in the Main module. In the class is a timer configured.
On the event of that timer, the class is calling the public function that changes the private variable in the Main module.
The call is done without callsub, just a call of the function -> Main.ThePublicFunctionInMainModule
Is there a chance, due to an event in the Main module, and the event from the class, that there is a collision? (accessing the same variable from the class and the Main)
Or is this impossible?
-Question 3:
I suppose Callsub is an event that "synchronizes" with the thread/class where it is called? Is this correct?
Thanks in advance,
Kind regards,
Coldrestart.