3
저는 델파이 XE5를 사용하여 작은 델파이 프로그램을 만들고 있습니다. 내 코드에는 동적 부울 배열이 있으며 일부 배열 요소의 값을 변경할 수 없습니다. 길이를 설정 한 후에 배열을 초기화하려고했지만 도움이되지 않았습니다. 다음은 코드의 일부입니다.델파이에서 부울 배열의 값을 변경하는 방법
procedure DoSomething(names: array of string);
var startWithA: array of Boolean;
i: integer;
begin
SetLength(startWithA, Length(names)); // each element is false by default
for i := 0 to Length(names) - 1 do begin
if (names[i].indexOf('A') = 0) then begin
startWithA[i] := true; // the value is not changed after executing this line
end;
end;
end;
좋은 마지막 함수 : –