[fixed] Bug on array

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

[fixed] Bug on array

Post 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.
Last edited by PeterH on 14 Jun 2023 20:54, edited 1 time in total.

admin
Site Admin
Posts: 66582
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Bug on array

Post by admin »

Should work better in next beta.

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Bug on array

Post by PeterH »

Thanks, good to hear!

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

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: [fixed] Bug on array

Post 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.

admin
Site Admin
Posts: 66582
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [fixed] Bug on array

Post by admin »

No. :) (too hard)

admin
Site Admin
Posts: 66582
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [fixed] Bug on array

Post by admin »

BTW, you can always check the variables by clicking the Variables button.

Post Reply