Accueil → WINDEV Mobile 23 → Global variable is forgotten
Global variable is forgotten
Débuté par Mirte VANBERGHEN, 09 mai 2018 15:21 - 1 réponse
Membre enregistré
7 messages
Posté le 09 mai 2018 - 15:21
Hi everyone

I'm creating an app in which I'm using threads in the Android part in order to make the HTTP requests run smoothly. Certain values from the logon are remembered in global variables after the first request in the first thread, but they don't seem to be remembered through the different threads and I don't know why or how to fix this ...

When I create an info popup with the value after every thread, it does get remembered and the request can use the value put in the variable, but if I don't the values are gone.
Is there someone who can help me fix this? Or who can tell me what I might be doing wrong or forgetting?

I've been told to make the declarations of the variables 'volatile', but Windev doesn't seem to support this by simply adding the word. Is there a different way of doing this? The theory for this is that the problem could be related to compiler optimizing.

I appreciate any help that anybody can give!!

Kind regards

Mirte Vanberghen
Membre enregistré
323 messages
Posté le 10 mai 2018 - 19:14
Hi Mirte

do you declare this variables on the window or on the project?

The type of the variable are equal to the data itself?
On your threads Do you use those variables to change the info or something?

Best regards