-->
Page 1 of 1

Array or slider bug

PostPosted: Sat Mar 18, 2017 8:35 am
by Luc Volders
Hi there,

For testing purposes for a specific project i need multiple sliders.
So I thought to be clever and made an array with 7 elements.
Next I put some sliders on the screen and used the array entries as slider value.

Not working.

Code: Select allslider testval(1), 0, 255


This snippet does not put the slider value into the array.

Look at the following code:

Code: Select alldim testval(6)

for x = 0 to 5
testval(x) = 0
next x

slider testval(1), 0, 255
wprint "<br>"
wprint "<br>"

slider testval(2), 0, 255
wprint "<br>"
wprint "<br>"

button "Change", [change]

wait

[change]
for x=0 to 5
wprint testval(x)
wprint "<br>"
next x
wait


If I change the variable in a normal variable like test1 and test2 the code works flawlessly.

So is the bug in the array function or in the slider function......

I can bypass this by using individual variables for the sliders. However If I need many sliders I am running against the varaiable limit of ESP-Basic, so using sliders with an array would be nice. Besides that I would like about 12 sliders (maybe more) and an array would make programming that a lot easier.

Luc

Re: Array or slider bug

PostPosted: Sun Mar 19, 2017 1:48 am
by Mmiscool
All of the gui object are limited to using only the normal variables. Not arrays.

Re: Array or slider bug

PostPosted: Sun Mar 19, 2017 4:40 am
by Luc Volders
That explains Mike !!!

Maybe something worth mentioning in the documentation.

Luc