Help with an application where every day a text appears

esq que ko que oasa is that I don't have a csv file

Use Notepad to type it up, one line per saying, and split it at \n after reading it to get a list.

Sample file:

It's always wise to parenthasize.
If in doubt, rip it out.
A fool and his money are soon parted.
You can lead a horse to a book but you can't make it read it.

¿So?
jal

Okay, good enough.

So I just save as .csv or .aia?

store your 5 items in a list and use the pick a random item block to display one of the items in a label

Taifun

pero quiero que cambie cada dia en un orden especifico

What am I doing wrong? I want a text to be displayed each day in a specific order so that when the counter reaches text 5 it resets again to the first one, I'm doing it with a timer

Please help me in this app I see that you know too much. What am I doing wrong? I want a text to be displayed each day in a specific order that when the counter reaches text 5 it resets again to the first, I'm doing it with a timer

ayudame en esta app por fvaor veo que sabes algo


¿Qué estoy haciendo mal? Quiero que un texto se muestre cada día en un orden específico que cuando el contador llegue al texto 5 se reinicie otra vez a al primero,lo estoy haciendo con un temporizador

Here is another way to get a different number every day for your list index.

The Clock component knows the day number for today.

There is a math block that can give you the remainder of a number if you divide it by another number like the length of your list of sayings.

That would give you a number in the range 0 up to 4.

Add 1 and you would get a number in the range 1 to 5.

That is a good index for your list.

1 Like

pero como? no entiendo

Let's see what you know about arithmetic.

What is today's date (1-31)?

What is the remainder if you try to divide it by 5?

1 Like

I don't know arithmetic, I already have this model and it works but there is a problem that it only works when I am using it

select item from list[index:modulus(current day/5)]

I don't understand

I thought of a way to do it for some one who does not know arithmetic (except for being able to add 1 to a number in the range of 1 to 5).

So no need to take off our shoes and socks for this either.

You need two TinyDB tags

  • LASTDATE (initially '')
  • LASTINDEX (initially 1)

In Screen1.Initialize

  • set global Today to Clock1.FormatDate(Clock1.Now())
  • set global SayingIndex to (get TinyDB1 value of tag LASTINDEX, default 1)
  • if global Today = (get TinyDB1 value of tag LASTDATE , default '') then
    • set LabelSaying.Text to (select item SayingIndex from list global Sayings)
  • else
    • set global SayingIndex to global SayingIndex + 1
    • if global SayingIndex > length of list global Sayings then
      • set global SayingIndex to 1
    • set LabelSaying.Text to (select item SayingIndex from list global Sayings)
    • store global SayingIndex to TinyDB tag LASTINDEX
    • store global Today to TinyDB tag LASTDATE
1 Like

Hello and it doesn't work
updateDay2.aia (33.0 KB)

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

You can't initialize a variable like that. Try to get the value from TinyDB in Initialize block.

And I guess you have not understood what to do with the clock. Read again the instructions above.

1 Like