List editor --- strange behaviour
|
11-21-2023, 05:56 PM
Post: #1
|
|||
|
|||
List editor --- strange behaviour
Hello,
the list editor does strange things: - I create a "List1" and put stuff into it - To save it, I create a new variable "List2" and store the contents of List1 there - Both appear in the list editor with correct content - I point to List1 and "Delete", confirmed with "OK" - List2 gets deleted, List1 is still there Is this a bug or is there some logic behind ? Regards Andreas |
|||
11-22-2023, 06:22 AM
(This post was last modified: 11-22-2023 07:12 AM by komame.)
Post: #2
|
|||
|
|||
RE: List editor --- strange behaviour
(11-21-2023 05:56 PM)DG7RBN Wrote: Hello, Have you used the DelHVars command? If so, you must make sure that the variable name is enclosed in quotation marks. If you did DelHVars(list2) instead of DelHVars("list2"), you can indeed experience such behaviors. The DelHVars syntax allows you to delete multiple variables simultaneously using their indexes. You can see the list of variables by using HVars. Code: list1:={1,2,3,4,5} It will return {"list1","list2", ... /other variables you had created/ } This is a list of variables that you can refer to by name or by index number. However, if you use a list instead of an index number, DelHVars will attempt to delete multiple variables at once, and indeed, in such a case, the behavior of DelHVars may seem a bit strange. Execute the following sequence of commands: Code: list1:={1,2,3,4,5} This should delete both list1 and list2, but it only deletes one or the other (depending on their order in the list). |
|||
11-22-2023, 09:52 AM
Post: #3
|
|||
|
|||
RE: List editor --- strange behaviour
I performed additional tests, and there is indeed a bug that causes the deletion of the wrong variable in the scenario you described (when using "Delete" in "Memory Manager" / "User Variables").
I have reported this in the bug tracker. |
|||
11-22-2023, 11:41 AM
Post: #4
|
|||
|
|||
RE: List editor --- strange behaviour
Hi Piotr,
the wrong deletion also happens with the "Delete" function in the list editor. Maybe same root cause. Did you report it to Jeff's bug tracker ? Andreas |
|||
11-22-2023, 07:48 PM
Post: #5
|
|||
|
|||
RE: List editor --- strange behaviour
(11-22-2023 11:41 AM)DG7RBN Wrote: the wrong deletion also happens with the "Delete" function in the list editor. Maybe same root cause. I suspect that variable deletion behaves incorrectly when there are multiple references to the same object in memory. In such cases, it always deletes the last assigned reference. For example: Code: a1:=1 (11-22-2023 11:41 AM)DG7RBN Wrote: Did you report it to Jeff's bug tracker ?Of course, in Jeff's bug tracker. Piotr |
|||
01-07-2024, 11:31 PM
Post: #6
|
|||
|
|||
RE: List editor --- strange behaviour
(11-22-2023 07:48 PM)komame Wrote:(11-22-2023 11:41 AM)DG7RBN Wrote: the wrong deletion also happens with the "Delete" function in the list editor. Maybe same root cause. You're very much on the right track! One interaction to try would be the following: Code: DelHVars({"a1","a2"}) Quote:⋮ Thanks! The bug has been fixed. |
|||
01-07-2024, 11:32 PM
Post: #7
|
|||
|
|||
RE: List editor --- strange behaviour | |||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)