Presetting the scene element spinner - help appreciated

317 views
Skip to first unread message

Gerard Jumeaux

unread,
Sep 5, 2014, 6:01:20 AM9/5/14
to tas...@googlegroups.com
Dear Tasker Forum,

I cannot find the error in my task. I'm trying to preset a spinner for month selection to the current month. This is the error code I get:

#SEHI: warning: select: bad index: 8, only 0 items

This happens even though the array is populated and the scene is created prior to setting the element value of spinner "Month". It works fine with presetting the number picker "Day" in the same scene. Somehow, the array is not recognized.

Creating the Array %Monat:
A1: Variable Set [ Name:%Monat To:Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember Do Maths:Off Append:Off ]
A2: Variable Split [ Name:%Monat Splitter:, Delete Base:Off ]
A3: Variable Set [ Name:%Heute To:2014,09,05,10,01 Do Maths:Off Append:Off ]

Scene creation and presetting:
A4: Create Scene [ Name: Kalender ]
A5: [X] Element Value [ Scene Name: Kalender Element:Month Value:%Heute2 ]
A6: Element Value [ Scene Name: Kalender Element:Day Value:%Heute3 ]
A7: Show Scene [ Name:Bier Kalender Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button:Off Continue Task Immediately:On ]

Any comments are higly appreciated 8-)

cheers,
Chris

PS: my topic came up in an earlier post, unfortunately without any solution:
https://groups.google.com/forum/#!topic/tasker/HuX8zjPX0RQ

Tasker Version: 4.4u3m
Android: 4.2 Samsung Stock

Pent

unread,
Sep 5, 2014, 11:22:46 AM9/5/14
to tas...@googlegroups.com

I cannot find the error in my task. I'm trying to preset a spinner for month selection to the current month. This is the error code I get:

#SEHI: warning: select: bad index: 8, only 0 items

This happens even though the array is populated

What 'Source' have you set for the spinner ? And what is your exact entry in the Variable parameter
in the Spinner element ? Try flashing the value before the Element Value action to check the contents.

Pent

Gerard Jumeaux

unread,
Sep 5, 2014, 12:10:26 PM9/5/14
to tas...@googlegroups.com
What 'Source' have you set for the spinner ? And what is your exact entry in the Variable parameter
in the Spinner element ? Try flashing the value before the Element Value action to check the contents.

Pent

Dear Pent, thanks for the reply.

The spinner source is set to 'Variable Array'.
The spinner variable field is set to '%Month'.
Flashing the values after scene creation, but before setting the element, %Heute2, %Monat(#) and %Monat(:) displays 09; 12; Jan,Feb,...,Dez as they are intended to.

I've exported the scene description below. My first guess was that 'Element Value 'Month' set to %Heute2' only accepts variables with the math option ticked, giving errors for a leading zero, e.g. January '01' to September '09'.

This is not the case since the problem is persisting after
(1) manually setting %Heute2 to a single number (math checked) and
(2) a Search/Replace deletion of leading zeros both do not work.
(3) setting the element number picker 'Day' to '09' results in number nine preselected in the scene.

Thanks again!
Cheers,
Chris


Here's the description (the value for Item Selected makes me curious):

Element: Month/Spinner
Content:
Source: Variable Array
Variable: %Monat
Item Layout: spinner
Events:
ItemSelected: 136
Items:
1. Label: Januar
2. Label: Februar
3. Label: März
4. Label: April
5. Label: Mai
6. Label: Juni
7. Label: Juli
8. Label: August
9. Label: September
10. Label: Oktober
11. Label: November
12. Label: Dezember

Element: Day/Number Picker
Content:
Min: 1
Max: 30
Default: 15
Wrap Around: Off
Events:
ValueSelected: 140

Gerard Jumeaux

unread,
Sep 8, 2014, 6:11:27 AM9/8/14
to tas...@googlegroups.com


Am Freitag, 5. September 2014 18:10:26 UTC+2 schrieb Gerard Jumeaux:
What 'Source' have you set for the spinner ? And what is your exact entry in the Variable parameter
in the Spinner element ? Try flashing the value before the Element Value action to check the contents.

Pent

Dear Pent, thanks for the reply.

The spinner source is set to 'Variable Array'.
The spinner variable field is set to '%Month'.
Flashing the values after scene creation, but before setting the element, %Heute2, %Monat(#) and %Monat(:) displays 09; 12; Jan,Feb,...,Dez as they are intended to.

UPDATE:

Defining the spinner source as a 'Variable Array' or 'Variable' with either set array or comma separated variable will show a correct spinner with all items at their place. For both cases, setting the Element Value for this spinner by hand to any number will result in the above error code.

#SEHI: warning: select: bad index: %, only 0 items

% in the above code has the value of the number i'm trying to set minus one, eg. set spinner element to 9 (Sept.) results in 'bad index: 8'. Although the spinner items appear in the description above, the spinner source is empty for 'Set Element Value'.

Hope you had a nice weekend.

Cheers,
Chris

Pent

unread,
Sep 8, 2014, 6:52:32 AM9/8/14
to tas...@googlegroups.com
Could reproduce this now, will investigate.

Pent
Reply all
Reply to author
Forward
0 new messages