Contenuto variabile non riconosciuto

Hello everyone,
practically if the variable "Insurance 1_12" is empty, then "LblNoticeInsurance" must not be visible. But in this case, if the variable "Insurance 1_12" contains a date within it, why is "LblAvvisoAssicurazione" not visible?
Greetings
Nicola

Today is 9-10-2023. How is the number 8-10-2024 obtained when we have not yet reached 2024? Didn't the variable refer to yesterday's date? it seems that you wrote it yourself (Do It Result)

There are lots of problems with your code. For starters, you cannot compare clock.now with a character string for example. You must first make a suitable string representation. And, what did you put in the TinyDB and how?

1 Like

Perhaps this is what you're trying to achieve?
blocks (11)

Note that you might want to store some arbitrary value of time in the variable (preferably in the evening), because time defaults to 00:00 (12 a.m.):

(all the images in this post are draggable)

@Arman 8-10-2024 comes from the fact that I had added 1 year to today's date.

@Ghica I inserted this into the TinyDB

What you are trying to do is really strange.
In LblScadenza1_12 you will have a string with a date one year from now. Then you try to add a number, 1 to that string, but you cannot add numbers to strings. Therefore you get the runtime error, something like this:

The operation + cannot accept the arguments: , ["okt. 10, 2024"], [1]
Note: You will not see another error reported for 5 seconds.

Try my little example and change it until it works.
scadenza.aia (2.2 KB)
Anyway, what would you really like to store in the TinyDB?

1 Like

@Ghica why, despite the variable Insurance 1_12 having a result inside it; Is LblNoticeInsurance still not visible?

Nicola, how could global Assicuratione1_12 ever be equal to Clock1.Now ??? Maybe for 1 second, but not longer. Try to see what you get if you use DoIt on Clock1.Now !!

I do not see LblNoticeInsurance in your blocks, maybe you mean LblAvvisoAssicuratione, which means the same?

@Ghica yes LblAvvisoAssicurazione has the same meaning

Nicola that does not answer the question why you are comparing apples to pears.
you should make a Clock instant from whatever you have in the TinyDB, and then compare it with Clock.Now, probably using =< instead of =.
Without looking at an .aia I cannot tell why you cannot see the label.
And, if you want to show blocks, click with your right mouse button on the block you want to show, or in an empty space if you want to show all, and choose download blocks as png. (you should know that by now :slightly_smiling_face:)

Nicola, I was thinking about a problem here, make sure that LblAvvisoAssicurazione is not in vertical/horizontal/table layout/s that they are invisible

@Ghica I tried to follow your advice, but I think I did something wrong :upside_down_face:

You first set LblScadenza to the global variable Assicurazione
Then later you convert Assicurazione into an instant and compare it again with LblScadenza...
Does this make sense? Not really...

Taifun

2 Likes

Instead of checking to see if the current time is equal to the given time, try to modify your code such that it checks to see if the given point in time is in the past (post #4).

Thanks for the very useful advice, have a nice day
Greetings
Nicola

1 Like

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