vblang icon indicating copy to clipboard operation
vblang copied to clipboard

[Proposal] Set operations on collections using []

Open VBAndCs opened this issue 5 years ago • 0 comments

In additions to #556 , these is some more [] operations:

Dim x = {1, 2, 3}
Dim y = {2,  1, 0}
Dim z = x[] + y[] ' z = {3, 3, 3}
z = x[offset:= 1 default:= 0] + y[] ' z = {4, 4, 0}
z[count:= 5 default:= 1] = x[] * y[] ' z = {2, 2, 0, 1, 1}

Just by using Offset, count, default in [], we can control how the loop is done and how the results are stored.

VBAndCs avatar Aug 30 '20 01:08 VBAndCs