[solved] array-elements in quotes not resolved

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%

[solved] array-elements in quotes not resolved

Post by PeterH »

Please say multiple "Oh no!" - I did.

So exec the included script, as is, and note the comments.
(Problem only on elements with index = characters)

You remember my un-answered questions about adding associate elements to an indexed array? You and I would not have thought of this answer, so:
in the script uncomment the upper stmt $As[0] = 0; making the array indexed, then exec again. The errors are gone :shock:
(No, I don't think this makes any sense. But is enough for another "Oh no!")

Code: Select all

// Test 0
// $As[0] = 0;

// Test 1
   $As['str'] = 'XYZ';
   $sav = $As['str'];
   Echo "$As['str']";   // >>> not resolved
   $As['str'] .= '789';
   Echo "Sav / New = <crlf>$sav<crlf 2>$As['str']"; // >>> array-name as well as <crlf 2> not resolved

// Test 2
   $As[2] = 'ABC';
   $sav = $As[2];
   Echo "$As[2]";
   $As[2] .= '123';
   Echo "Sav / New = <crlf>$sav<crlf 2>$As[2]"; //
// Test 3
   $sav = $As['str'];
   Echo "$As['str']";   // >>> not resolved
   $As['str'] .= '789';
   Echo "Sav / New = <crlf>$sav<crlf 2>$As['str']"; // >>> array-name as well as <crlf 2> not resolved
edit: typo again
Last edited by PeterH on 08 Aug 2023 12:47, edited 1 time in total.

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

Re: array-elements in quotes not resolved

Post by admin »

Yep, that's a bug. :bug: Fixed in next beta. :tup:

That uncommenting $As[0] = 0; makes it work is just a coincidence.

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

Re: array-elements in quotes not resolved

Post by PeterH »

A short reply: :tup:

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

Re: array-elements in quotes not resolved

Post by PeterH »

And now: tested test & prod scripts: :tup: :tup:

Thanks again!

Post Reply