Post Reply 
List editor --- strange behaviour
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,
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

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}
list2:=list1
HVars

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}
list2:=list1
DelHVars({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).
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
List editor --- strange behaviour - DG7RBN - 11-21-2023, 05:56 PM
RE: List editor --- strange behaviour - komame - 11-22-2023 06:22 AM



User(s) browsing this thread: 2 Guest(s)