Page 1 of 1

[fixed] Bug on array

Posted: 14 Jun 2023 17:37
by PeterH
I just thought: give arrays a new chance :?

So I had a line like

Code: Select all

   echo "title($nr) = '$title[$nr]'.";
$title[$nr] was shown as empty - though I definitly had set it to some text.
Guess how much step; could help me on debugging... :blackstorm:

OK: after several tests

Code: Select all

   $tit = $title[$nr];
   echo "title($nr) = '$tit'";
showed the correct result. :shock:

In the end:
"$title[3]" is OK inside quotes,
"$title[$nr]" leads to empty.

Though I'm disappointed by arrays (again), I think I should at least report it.
(And wonder why no one else seams to have? How can it get better without?)

And try to remember: "Don't use arrays". :ninja:

(With the currrent available functions for arrays, gettoken() & gettokenindex() seem to be much more powerful to me.)

Sorry for mocking around again.

Re: Bug on array

Posted: 14 Jun 2023 19:15
by admin
Should work better in next beta.

Re: Bug on array

Posted: 14 Jun 2023 19:27
by PeterH
Thanks, good to hear!

Sometimes I don't listen to my own words - so I will have a try :whistle:

Re: [fixed] Bug on array

Posted: 14 Jun 2023 21:04
by PeterH
OK: quick fix, quick test, quick OK!

Though a question to stepping-info: in the final display of execution of an array instruction with a var as index, you at least show the new value of the array-variable, but not the real index but only the name of the index var. (What a sentence...)
Could you change that to show the real index? So at least we can see that we set the correct var? Would be a first help on debugging.

Re: [fixed] Bug on array

Posted: 14 Jun 2023 21:05
by admin
No. :) (too hard)

Re: [fixed] Bug on array

Posted: 14 Jun 2023 21:29
by admin
BTW, you can always check the variables by clicking the Variables button.