I tried to use SetLength to make my array shorter and it shows me incompatible types. Here's my coding:
var
A : Array[1..max] of string;
K : Word;
...
SetLength(A,K);
Is it because this array is not a dynamic array or something? If that's the problem, how do i fix it?
You can only use SetLength
for dynamic arrays (and strings). Your declared array is a static array instead. It has a fixed length at compile-time that cannot be changed at run-time.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加