[solved] It seems a BUG with an (assoc.) array defined global

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] It seems a BUG with an (assoc.) array defined global

Post by PeterH »

Hi there - still scripting with arrays :P

I need to define an array (to say: associative) as global.

First run the attached script with the commented Global statement: it's OK.
(Though I didn't ecpect the result with index [0] and [1]...)

Then de-comment the Global stmt: now index 'ss', 'count', and 0 all show the second = the last set value, i.e. 5, while the first set value is lost.

(I really don't search these :bug: :bug: :bug: - they just find me :whistle: )
To see the attached files, you need to log into the forum.
Last edited by PeterH on 26 Jul 2024 23:16, edited 1 time in total.

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

Re: It seems a BUG with an (assoc.) array defined global

Post by admin »

Confirmed, you got another one. :tup: :bug:

Fixed in next beta. :cup:

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

Re: It seems a BUG with an (assoc.) array defined global

Post by PeterH »

Thanks :tup:

I'll test your fix when available.

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

Re: It seems a BUG with an (assoc.) array defined global

Post by PeterH »

OK, verified: the (old) :bug: is gone :tup: :tup:
--------------------------------------------

But now i need some help - for a follow-up error that happens, but can't be reproduced by me in a short version! :blackstorm:

To demonstrate it I attached the demo-version: it's like before but:
- 2 more elements added to the array (like in real)
- a call to DBGVarMt with: an Identification; the (global) array; and a parm to activate stepping
- the function DBGVarMt that just echoes one element of the array.
Problem: "no error"! Even call to the real function (now commented): no error!!!

The same, in real world:
- stops on STEP; before the call,
- and on Continue *immediate*, i.e. before executing anything in the function, shows:

---------------------------------------------------------------------------------
-BUG- Error 9

Error: 9 (0x00000009)
Desc: Subscript out of range
Dll: 0
Proc: script_Process: call

Source: XYplorer
XY ver: XYplorer 26.30.0001 - Lifetime License Enterprise
OS: Windows 11 Pro, 64-bit, Version 23H2, Build 22631.3880 (10.0)
Locale: 1031 (de-DE)
ANSI: 1252, ACP: 1252 (ANSI - Lateinisch I)
Font: Segoe UI 9, Segoe UI 9, DBCS: No
DPI: 96 (100%), 1920x1200

Date: 2024-07-23 15:57:05
---------------------------------------------------------------------------------

So in short: do you have any idea what I can/should look for to get more info?
(What's the combi: "Subscript out of range" for "script_Process: call"?
To say: commenting the (real) Global stmt leads for the error to disappear - all works well!
(But the logic later on will fail...)

The real Function is made to show, as debug help, the contents of all supplied variables - for Arrays it shows *every* Element. But it doesn't know anything about the global state...

You do NOT want to look at the real function - it's harmless (say I), but it's a real monster!
To see the attached files, you need to log into the forum.

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

Re: It seems a BUG with an (assoc.) array defined global

Post by PeterH »

>>> It seems I found something - Just wait a bit... <<<

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

Re: It seems a BUG with an (assoc.) array defined global

Post by PeterH »

OK: could reproduce the (new) :bug: !
(Now I think I can name it bug, too!)

First I deleted code inside real DBGVarM() - at last there was only a STEP;
Calling it with the Global Array still lead to Error 9. 8-)
Without the Global still no error.

What's the difference to the test code???
OK: *in real* the code defining the Global itself is in a function!
Simulated this in test-code: the :bug: is there!

So attached is a slightly enhanced code to reproduce the :bug: .
To see the attached files, you need to log into the forum.

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

Re: It seems a BUG with an (assoc.) array defined global

Post by admin »

Not sure what your code is trying to do, but it will run without error 9 in the next beta.

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

Re: [solved] It seems a BUG with an (assoc.) array defined global

Post by PeterH »

Thanks - solved in mini-test as well as in real world! :tup: :beer:

Now I must solve an own :bug: :whistle:

Post Reply