Hi everyone! I am having issues with this block on thunkable X. Could somebody help me please?
I have two numbers saved on variables called “app variable qtd antiga” and “app variable botão+ naked” and I need to sum both of them, but it returns “NaN”.
Yes, it returns that the app variable “qtd antiga” is not a number, but I initialize this variable to number 1 and I set this variable to a number from the list “app variable Lista Contador”. I dont know why is this not a number
Without knowing what all the variables are (there are several I don’t see defined in the screenshot), it’s hard to identify the problem. Two thoughts:
add a 1s wait block between existing blocks. Occasionally, I’ve seen it where the setting action in the previous block isn’t done before the next block starts, which might explain it. Easy to try, anyway.
Do more debugging. You know you’re getting to the end with a NaN value. Add a “set label’s text” at a bunch of intermediate steps. Hopefully you’ll easily spot where things go wrong.
Most likely, you need to convert those two values to numbers by adding zero to each before you try to get the sum. If that still doesn’t work, then you need to check the value of each variable using a label first.
Thank you for answering it! I added the zero before I tried to get the sum. The problem is that when I get the first occurence of an item from a list “Lista Produtos”, it returns a number. But then, when I set a variable called “qtd antiga” to get the item from this position from a list, that is a number, it returns “NaN”. It doesn’t make any sense…
Oi taiskleinoliveira8y3
Pelo seu código imagino que fale português né?
Você conhece alguma comunidade brasileira de thunkable?
Aqui é bom, mas é raro encontrar “BR”.
Eu ouvi dizer que o thunkable classico vai acabar, ou que o google não vai mais dar suporte aos apps criados com ele, por causa da API 29.
É verdade isso?
Será que vale a pena migrar pro thunkable x?
Oii! Sim, falo português! Nao conheço comunidade de brasileiros, mas seria bem bom encontrar haha. Olha, não sei mesmo… eu comecei direto no thunkable X, nunca usei o clássico, porque queria criar direto pra IOS junto com android. Mas acredito que dê pra perguntar no chat do thunkable pros profissionais do thunkable mesmo!
I put everything with “0+”, but the “app variable qtd antiga” is still “NaN”. The “app variable botao+naked” is a number and I can do other calculation with it.
Then you have to debug the app variable teste final. Figure out where you’re setting it’s value. Either post a screenshot of those blocks or a link to your project.
in list [app variable Lista Contador] get # (in list [app variable Lista Produtos] find first occurrence of item [j]) + 0
I would like to ask about the variable j here. This block is usually used when you are iterating through a list, but I can see that there is no for each item j in list block here. I also don’t see a block where the value of j is set in this screenshot.
What value do you expect j to have in these blocks?