I would like to understand why my Global variable doesn’t work outside of Got Value.
If everything went well, within the Got Value event, there would only be the global set line Venda to…
All other lines are just an attempt to find where my variable got lost.
What I wish:
As soon as my screen starts, I need to get the amount of sales made for a product on the day, that is, how many times have I sold, for example, WATER today?
I understood that the size of the list offers me this value and so far everything is ok. And that would be enough for me.
Hence the global set line sell to length of list get value. And that’s perfect. As I said, that was enough.
But, as I have to check other products as well like Coke, Hot Dog … I need to run this same routine several times and then I decided to create a specific variable for the product.
So, going back to the pega_nr_venda procedure after the nr_agua call, I try to put the value of the global variable Venda (which until then was perfect) in the global variable Venda_agua and move on to the next product.
That’s when I realized the value was lost. The global variable sell outside the Got Value block, lost its value.
This is evident in Label 4 where it takes on the value 1 which is its initialization value.
Why does it happen? How can I continue with the value?
Detail: I already tried to put global set venda_agua to label3.text. It doesn’t work either. If it worked, just give a visible.false on label3 and that would solve it.
Thank you for your help.
I am making some sales of some products. That way, on sale 01 I can sell 3 bottles of water, on sale 2, I can sell 1 hot dog and on sale 3 I can sell 1 bottle of water again.
So my DB would look like this:
|-------- 1: 3
|-------- 2: 1
|-------- 1: 1
If the application closes, I need to continue selling, get the number of the next sale of each product. So, I need to get that for water, I will do the 3rd sale and, for the hot dog, I will do the 2nd sale.
Taking the length of the list, I have this information, but outside of Got Value this value is lost and I can’t record it on the next sale.
Was it possible to understand? I’m not understanding why the value is lost when exiting the Got Value block.