Weird bug/problem with global variables and procedures, please help

So i encounter something quite strange which i cant explain why it happen… maybe i just missed all the clue? the problem is:

for some reason the global variable “entitylist” cannot be passed to the procedure, basicly i put label 1 , label 2 and label 3 to see what gone wrong, and the result is label 2 got the list value and label 1 , label 3 is blank for some reason. I tried opening a new project to test this (this is the new project i created) and the same problem appeared too, so did i do anything wrong? ps. label 2 can get the value so it is definitely not the tinywebdb problem.

check if label 1 and label 3 are visible or not.

no i mean it print out an empty list “()” , which mean no value passed to the variable

ok do one thing after calling tiny db set clock 1 timer enable to true
(use clock component of timing 2500 (2.5 seconds)) and in clock 1 timer do block call verify or create player and set label 3 text to enitiylist variable.

Facing the same problem when a procedure calls the Firebase Event Tag List.

Should we move this topic to the bug session?

same suggestion for you use clock component while getting values and when you successfully then do the block in clock 1 timer do.

but label 2 got the value so it is not latency or desync problem, why the clock timer?

it is latency problem because label 2 is set when you get the value from tiny db.

just try what i said and see if it owrks for you chances are it will work.

I don’t think that it would be a good practice…
I mean, we are slowing our apps to work with the platform? It doesn’t make sense…

but then the value is stored to the local global variable so how come it is a latency problem?
that local variable is extacly what label 2 showing, label 2 make sure the value did get stored in global entitylist

@guilhermemaracaipe it completely make sense haven’t you seen any progress dialogs in app while doing processess. those progress dialogs are there so that app can do work in background.
and if hyou seriously think 3 second will slow down your app then there is no other solution for you.

@hotsunngai atleast try it then post you are not trying the solution given to you. if it not works then we will another solution but atleast first try the these

ok no problem :smiley:

and it worked! Thank you so much :smiley:
but why though?

mark it as solution if it works for you.

it worked because after calling tinydb you were instantly using the variable. and that time the variable is just an empty list. but after 3 sec it gets value. thats why it worked.

How about putting your blocks in the right order




1 Like

but that procedure is suppose to run once when the screen initialize, not everytime a value received though, i will stick to that delay thing until it didn’t work for now :smiley:

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