Page 1 of 1

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

Posted: 22 Jul 2024 00:15
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: )

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

Posted: 23 Jul 2024 11:10
by admin
Confirmed, you got another one. :tup: :bug:

Fixed in next beta. :cup:

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

Posted: 23 Jul 2024 11:27
by PeterH
Thanks :tup:

I'll test your fix when available.

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

Posted: 23 Jul 2024 22:40
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!

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

Posted: 24 Jul 2024 12:40
by PeterH
>>> It seems I found something - Just wait a bit... <<<

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

Posted: 24 Jul 2024 13:03
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: .

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

Posted: 26 Jul 2024 17:19
by admin
Not sure what your code is trying to do, but it will run without error 9 in the next beta.

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

Posted: 26 Jul 2024 23:19
by PeterH
Thanks - solved in mini-test as well as in real world! :tup: :beer:

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