Page 1 of 1

[Wish:] Wish to support a[2]:=(x?)

Posted: 14 Aug 2023, 15:10
by V2User

Code: Select all

a:=[1,5,2,3]
a[2]:=(x?)
c:=a[2]
OutputDebug(IsSet(c))
image.png
image.png (33.35 KiB) Viewed 1297 times
Currently, it will throw an error. But it might be better, if array assignment could act as property assignment.

Re: [Wish:] Wish to support a[2]:=(x?)  Topic is solved

Posted: 14 Aug 2023, 19:45
by lexikos
The new documentation already says "Unsetting a variable or array element removes its value", but I haven't actually updated the behaviour for assignments yet.

However,

Code: Select all

c:=a[2]
OutputDebug(IsSet(c))
IsSet can't be called in this code if a[2] is unset, because you did not use ?.