I'm hoping someone here can help me solve this problem. I would be very grateful, and you will have great luck this year!
I encountered the following error message in my app:
Bad arguments to select list item – the operation select list item cannot accept the arguments: , [2], [1]
I believe the issue is somewhere in the section I circled in the picture.
I have three lists: "Motor_A_List", "Motor_B_List", and "Time_List". Since they function the same way, I'll use "Motor_A_List" as an example to explain my question.
I initialized Motor_A_List with all elements set to "0" (as strings). For testing purposes, I set only two elements in the list. In the timer block, I set a for loop from index 1 to num_stage = 2. I don’t think the issue is related to an out-of-range index.
I know that an empty element in the list could cause this error. However, if I didn’t change the content of the textbox, Motor_A_List should remain ["0", "0"], right?
Even when I modified the textbox, I only changed the corresponding list element when textbox ≠ "".
So, I can't understand what is causing the problem.
I would really appreciate any guidance.
The init value action happens only once at start of screen, and the variable then is no longer associated with the textboxes or labels referenced in its init bock.
So you can't update the background colors or text values from the global variable.
If you want to do that, you instead need to just store the component blocks in the global init lists, and use generic (Any component) blocks to update the selected component.
For just two items per list, you might find it barely worth the trouble.
Yeah, the argument issue was resolved after changing num_stage to Time_List. I had checked multiple times but didn’t notice that bug. Sorry for the silly mistake, and many thanks!
I’d also like to follow up on the issue you mentioned.
How can I store the component blocks in the global init lists? I couldn’t find the init list block.
Currently, each list contains only two items for testing, but I plan to extend them to ten items. Is there a more convenient way to change the textbox background color?