Delphi Error – E2454 Slice standard function not allowed for VAR nor OUT argument

Delphi Compiler Error

E2454 Slice standard function not allowed for VAR nor OUT argument

Reason for the Error & Solution

You cannot write back to a slice of an array, so you cannot use the slice standard function to pass an argument that is var or out. If you must modify the array, either pass in the full array or use an array variable to hold the desired part of the full array.