Why 2 label widgets can`t update their values at the same time

I`m making a game that needs to update 2 variables at once, so I used labels during testing to be used as a displayer for the 2 variables I need to update. But when I used it, only 1 update, I don't know what's the issue/bug. The label that didn't update is mntCost. This is my code and all of the referenced functions

image
image
image

Try setting your two labels at the end (inside) of the EFF_saveAllValues procedure?

All of them update, but the mntCost label updates only once

e2dee64a0c9b4cfbf482e887130cb71651b1d17a
ab0329ec70eb19abe49c60cc4baa8958392de6f0 (1)
See the difference?

That's why it is a good idea to init global constant variables for those tag texts, adding _TAG to the variable name, and using the global variables instead of the text blocks.

init global mntCost_TAG 'mntCost'

call TinyDB GetValue(global mntCost_TAG,...)

This also helps with typeblocking.

3 Likes

thanks for the solution, highlight, and an advice to improve my code style!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.