Array.zero()

From ZCubes Wiki
Revision as of 15:41, 4 March 2017 by Joseph (talk | contribs) (Created page with "* << Z3 Home * Z3 Language Documentation * Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member F...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Array.zero(OtherNumber, PreserveArrayStructure)

Replace all elements of the array by 0. If OtherNumber is given, that number is used instead.

The original array is replaced at the top level, unless PreserveArrayStructure is set to true.

1..10.zero()

0
0
0
0
0
0
0
0
0
0

1..10.zero(1..10)

1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10

[1,2,[3]].zero(3)

3
3
3

[1,2,[3]].zero(3,true)

3
3
3