-
Notifications
You must be signed in to change notification settings - Fork 758
Deletearray
Haru edited this page Oct 19, 2016
·
1 revision
- deletearray <array></array>, <amount></amount>;
This command deletes a range of values within given array and shifts remaining values to fill the deletion gap.
Important: Currently (r14395) the command uses getarraysize internally, which leads to unpredictable results with arrays, that contain empty elements. It is recommended to use a combination of copyarray and cleararray instead.
'''deletearray''' @array, 10;
Deletes the first 10 elements of the array and shifts all other values by one to the left.
[[copyarray]] @array[0], @array[10], 90; [[cleararray]] @array[90], 0, 10;
Assuming @array has 100 elements, this achieves the same effect as the example above, but works properly even if @array has empty element(s).