Screen initialization and button click

I wrote two programs. When I use the button to click, I can get the result I expected. But when I use screen initialization, I cannot get the same result as button click. Here I want to use screen initialization.

Please tell me what is the functional difference between screen initialization and button click?

Thank you in advance for your reply!

Screen initialise may need a little time to run the commands. Try a clock timer with 250ms to run the blocks you have in screen initialise

1 Like

You can use for each item loop in When TagList event, this will return you same result what you want, but it may fix the problem

The problem is that you expect the global variable songList to have the results from the TagList event before the TagList event had a chance to fire.

To correct this, move the foreach item list songList loop out of Screen.Initialize and into the .TagList event, at the bottom, after assignment into the global songList.

2 Likes

1 Like

My guess is that it works with the button click because the screen initialise has called the taglist.

2 Likes

Try to use this, it may help you

1 Like

I am sorry it is not work. Thanks for your kindly reply!

Try this:

Firebase content
image
Blocks


Output
image

1 Like

Sorry, I didn't catch you. Please tell me how to do? Thanks!!!

TIMAI21|690x283

You are good at ignoring the samples prepared for you.

Why do you change them to make them not work?

1 Like

Please tell me which examples I have overlooked! Thank you for telling me.

Look at my blocks image again. Make you blocks to match my blocks, then test. The image you put up shows that you did not do this first time around.

image

2 Likes

Hi, TIMAI2,

I am really so sorry to waste your time.
I do really ignore the samples you prepared for me.
I get the result what I need.
Thank you very much for your reply and patience!

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