Misteri della programmazione

Salve a tutti,
vi faccio vedere una cosa stranissima.
Questo è il designer della mia app:


Mentre questa è la mia app, mentre viene eseguita con il companion:

:thinking: :thinking: :thinking: :thinking:

You do not show what is at the top of your screen in designer

You probably do not set the visibility of the image/arrangement for that view....

Scusami @TIMAI2 ma ho dimenticato di specificare qual' è il problema che mi capita. Praticamente nonostante nel designer siano presenti i valori "1" in entrambe le label, nel momento in cui provo la mia app nel companion; all'impovviso entrambe le label diventano "0" :thinking: :thinking: :thinking: :thinking:

1 Like

Could you share your .aia for us to test ?

In which case, are you sure you are not setting those two labels to 0 in your initialisation blocks ?

Difficult to tell from just a picture of your designer

@TIMAI2 a 0 ho impostato ovviamente solo le variabili che dovevano contenere un carattere numerico.
Cmq adesso metto il file AIA
ConsumoCarburante_copy2 (20).aia (703.6 KB)

Not quite sure what is going on here....

You appear to be trying to set the first label with six different values from tinydb.

It is likely that one or all of these do not exist, therefore you are getting a 0 instead

In pratica, quando tramite BtnGPLPlus l'indicatore numerico del GPL corrisponde al numero 3; vado ad effettuare il salvataggio del numero 3 nel tag "Indicatore3GPLPlus e lo vado a leggere tramite LblRifornimentoResiduoGPL3.

In the Consumi.Initialize() event, you've set the First Problematic Label's valueIfTagNotThere to 0. There is the problem. Also, what you're trying to do in the Initialize will not work and show only the last result. [Setting the Label text to TinyDB.getValue(String tag, 0).]

Same for the Second Problematic label.

@SHUBHAMR69 in Consumi.Initialize() ho impostato valueIfTagNotThere su 0 perchè la variabile contiene un valore numerico. Inoltre io voglio che effettui il salvataggio solo dell'ultimo risultato. In ValueIfTagNotThere potrei anche inserire un carattere alfanumerico?

1 Like

@SHUBHAMR69 ho addirittura impostato nel codice che entrambe le label devono avere il valore 1; ma continua a visualizzarmi per entrambe, il valore 0 :upside_down_face:

1 Like

I told to set it in the valueIfTagNotThere parameter in the TinyDB.getValue blocks. (All of them.)

You can do this:

.... but potentially, the Tag is there and the value stored is 0. DoIt can tell you that.